error: 'Can't connect to local MySQL server through socket '/data/3307/data/mysql.sock' (2)'

centos7.5 重启mysql报错

问题:

[root@db01-51 ~]# mysqladmin -uroot -p123 -S /data/3307/data/mysql.sock shutdown
Warning: Using a password on the command line interface can be insecure.
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/data/3307/data/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/data/3307/data/mysql.sock' exists!

原因:

数据库文件损坏导致没有sock

解决方法:

方法一: 导入从库中的sock

方法二: 物理备份恢复
上一篇:通过jedis远程访问redis服务器


下一篇:android https通过载入pfx证书获取数据