当前位置:网站首页>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
边栏推荐
- Vscode status bar statusbar
- Mo Tianlun salon | Tsinghua qiaojialin: Apache iotdb, originated from Tsinghua, is building an open source ecological road
- TiDB Dashboard里面可以写sql执行吗
- 漏洞复现----37、Apache Unomi 远程代码执行漏洞 (CVE-2020-13942)
- What should I pay attention to when playing futures? Where is safe to open an account? It's my first contact
- 基于SSH的客户关系CRM管理系统
- 港科大&MSRA新研究:关于图像到图像转换,Finetuning is all you need
- Flink series: checkpoint tuning
- 又一篇CVPR 2022论文被指抄袭,平安保险研究者控诉IBM苏黎世团队
- 先写API文档还是先写代码?
猜你喜欢

MySQL reports that the column timestamp field cannot be null

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

Add code block in word (Reprint)

Redis (VII) - sentry

Dropout: immediate deactivation

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

ASP. Net password encryption and password login

News management system based on SSM

基于SSM的新闻管理系统

DeFi借贷协议机制对比:Euler、Compound、Aave和Rari Capital
随机推荐
Redis (III) - transaction
Switching routing (VLAN) experiment
助力极致体验,火山引擎边缘计算最佳实践
Volcano engine was selected into the first "panorama of edge computing industry" in China
The secondary menu of the magic article system v5.4.0 supports the optimization of form display
uni-app进阶之自定义【day13】
Thinking on large file processing (upload, download)
New research of HKUST & MsrA: about image to image conversion, finishing is all you need
Another CVPR 2022 paper was accused of plagiarism, and Ping An insurance researchers sued IBM Zurich team
MySQL advanced - index optimization (super detailed)
Alexnet of CNN classic network (Theory)
麻烦问下 Flink支持同步数据到 sqlserver么
MySQL advanced - basic index and seven joins
Daily interview 1 question - how to prevent CDN protection from being bypassed
ASP. Net generate verification code
剑指 Offer 16. 数值的整数次方
Babbitt | yuanuniverse daily must read: minors ask for a refund after a reward. The virtual anchor says he is a big wrongdoer. How do you think of this regulatory loophole
Redis (VI) - master-slave replication
C language structure
Conception d'un centre commercial en ligne basé sur SSH