当前位置:网站首页>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
边栏推荐
- ABAP-发布Restful服务
- C# Winform程序界面优化实例
- 基於SSH的網上商城設計
- LeetCode之合并二叉树
- The company was jailed for nonstandard bug during the test ~ [cartoon version]
- Alexnet of CNN classic network (Theory)
- New research of HKUST & MsrA: about image to image conversion, finishing is all you need
- Development details of NFT casting trading platform
- Ardunio esp32 obtains real-time temperature and humidity in mqtt protocol (DH11)
- If you want to learn software testing, you must see series, 2022 software testing engineer's career development
猜你喜欢

剑指 Offer 16. 数值的整数次方

Apache parsing vulnerability (cve-2017-15715)_ Vulnerability recurrence

ASP. Net authentication code login

Redis (I) - data type

Helping the ultimate experience, best practice of volcano engine edge computing

先写API文档还是先写代码?

Oneortwo bugs in "software testing" are small things, but security vulnerabilities are big things. We must pay attention to them

Nft: unlimited possibilities to open the era of encryption Art

Daily interview 1 question - basic interview question of blue team - emergency response (1) basic idea process of emergency response +windows intrusion screening idea
![[PROJECT] Xiaomao school (IX)](/img/01/f7fc609e7a156d6e60ce6482ba2ac1.jpg)
[PROJECT] Xiaomao school (IX)
随机推荐
程序员女友给我做了一个疲劳驾驶检测
Deep understanding of JVM (V) - garbage collection (II)
麻烦问下 Flink支持同步数据到 sqlserver么
基于SSH的客户关系CRM管理系统
Php8.0 environment detailed installation tutorial
Shortcut keys for the rainbow brackets plug-in
Helping the ultimate experience, best practice of volcano engine edge computing
Redis (VI) - master-slave replication
Conception d'un centre commercial en ligne basé sur SSH
ASP. Net generate verification code
大文件处理(上传,下载)思考
Several points in MySQL that are easy to ignore and forget
Word中添加代码块(转载)
后渗透之文件系统+上传下载文件
LRN local response normalization
What should I pay attention to when playing futures? Where is safe to open an account? It's my first contact
Redis (IX) - enterprise level solution (II)
[machine learning] K-means clustering analysis
剑指 Offer 17. 打印从1到最大的n位数
Type ~ storage ~ variable in C #