当前位置:网站首页>MySQL cannot find mysql Temporary solution of sock file
MySQL cannot find mysql Temporary solution of sock file
2022-06-30 18:25:00 【Selondier】
An error occurred when connecting to the database :Can 't connect to local MySQL server through socket '/tmp/mysql.sock '(2) ";
reason :1)mysql The service didn't start ;2)sock File path setting error ;3)sock The permission of the directory where the file is located ;4) This file is lost directly
1) Check whether the service is started
2) stay my.cnf View in file socket The path specified by the parameter , Check whether the path has access rights
3) Go to this path to check whether it exists mysql.sock file , If sock file does not exist , Try to use find Command to search the file , If the search fails , It can be restarted mysql service , It will automatically generate a . Then copy the file to soctek The path specified by the parameter . Or create a soft link , For example, this file is in /var/lib/mysql.sock,socket The path specified by the parameter is /tmp/mysql.sock. We can create :ln -s /var/lib/mysql.sock /tmp/mysql.sock, After creation , Retry connection
4) If still wrong , You can use TCP/IP To connect
mysql -u root -h Database server's IP -p
or mysql -u root -h 127.0.0.1 -p
边栏推荐
- [PROJECT] Xiaomao school (IX)
- News management system based on SSM
- Animesr: learnable degradation operator and new real world animation VSR dataset
- Vue3 reactive database
- 100 examples of bug records of unity development (the first example) -- shader failure or bug after packaging
- What should I pay attention to when playing futures? Where is safe to open an account? It's my first contact
- 漏洞复现----38、ThinkPHP5 5.0.23 远程代码执行漏洞
- C language structure
- [cloud resident co creation] Huawei iconnect enables IOT terminals to connect at one touch
- MySQL advanced - Architecture
猜你喜欢

ASP. Net authentication code login

Do you write API documents or code first?

Communication network electronic billing system based on SSH

Vulnerability recurrence ----- 38. Thinkphp5 5.0.23 Remote Code Execution Vulnerability

漏洞复现----35、uWSGI PHP 目录遍历漏洞 (CVE-2018-7490)

分布式场景下,你知道有几种生成唯一ID的方式嘛?

后渗透之文件系统+上传下载文件

News management system based on SSM

元宇宙带来的游戏变革会是怎样的?

DeFi借贷协议机制对比:Euler、Compound、Aave和Rari Capital
随机推荐
Importing alicloud ECS locally to solve deployment problems
MySQL advanced - basic index and seven joins
Vscode status bar statusbar
Conception d'un centre commercial en ligne basé sur SSH
Solve the problem of unable to connect to command metric stream and related problems in the hystrix dashboard
[machine learning] K-means clustering analysis
基于SSH的客户关系CRM管理系统
ASP. Net password encryption and password login
MySQL找不到mysql.sock文件的临时解
MySQL advanced - Architecture
Deep understanding of JVM (III) - memory structure (III)
Only black-and-white box test is required for test opening post? No, but also learn performance test
【二叉树】前序遍历构造二叉搜索树
助力极致体验,火山引擎边缘计算最佳实践
Lenovo's "dual platform" operation and maintenance solution helps to comprehensively improve the intelligent management ability of the intelligent medical industry
每日面试1题-蓝队基础面试题-应急响应(1)应急响应基本思路流程+Windows入侵排查思路
Word中添加代码块(转载)
报名“互联网+”大赛华为云命题,诸多礼品任你拿!
Flink系列:checkpoint调优
.NET ORM框架HiSql实战-第一章-集成HiSql