admin管理员组文章数量:1130349
登陆MySQL数据库报如下错误。
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
设置MySQL数据库忘记密码,然后在/etc/myf中设置了如下参数 还是报相同的错误。
skip-grant-tables
解决方法
1.检查报错的/tmp目录下是否存在mysql.sock文件
经过检查,mysql.sock文件不在/tmp目录下。
2.在linux系统查找报错的文件mysql.sock
[root@admin ~]# find / -name mysql.sock
/usr/local/mysql/tmp/mysql.sock
3.设置mysql.sock文件的软链接到/tmp目录下
ln -s /usr/local/mysql/tmp/mysql.sock /tmp/
4.再次登陆MySQL数据库 登陆成功!
登陆MySQL数据库报如下错误。
Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
设置MySQL数据库忘记密码,然后在/etc/myf中设置了如下参数 还是报相同的错误。
skip-grant-tables
解决方法
1.检查报错的/tmp目录下是否存在mysql.sock文件
经过检查,mysql.sock文件不在/tmp目录下。
2.在linux系统查找报错的文件mysql.sock
[root@admin ~]# find / -name mysql.sock
/usr/local/mysql/tmp/mysql.sock
3.设置mysql.sock文件的软链接到/tmp目录下
ln -s /usr/local/mysql/tmp/mysql.sock /tmp/
4.再次登陆MySQL数据库 登陆成功!
版权声明:本文标题:Can’t connect to local MySQL server through socket ‘tmpmysql.sock’ (2) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/jiaocheng/1755027758a2755281.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论