Ubuntu连接MySql报错“can't connect to local mysql server through socket '/var/run/mysqld/mysqld.sock'”


在不重新安装mysql的情况下,通过如下命令来解决,具体的就是先停止mysql服务,再重新开启mysql服务

cd /etc/init.d

sudo service mysql stop

sudo service mysql start 

 

导致这个问题的原因是服务器存储空间不足了!!!

 

后续还发现了一种情况,存储空间还有也报这个异常了,查看数据库日志:

Initialzation of the server's UUID failed because it could not be read from the auto.cnf file. If this is a new server, the initialization failed because it was not possible to generate a new UUID.

 

网上说是UUID生成有问题,打开/var/lib/mysql/auto.cnf 查看UUID时发现乱码,怀疑是文件损坏。把这个文件的文本内容全部清了,重启服务器即可解决!!!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM