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时发现乱码,怀疑是文件损坏。把这个文件的文本内容全部清了,重启服务器即可解决!!!