无法连接MySQL数据库错误总结

1、可能密码不对

[root@slave162 mysql3311]# mysql -uroot -P3311 -h192.168.60.162 -p123
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'slave162.netposa' (using password: YES)
错误原因:可能是用户名或密码不对,或者权限不够

解决方法:检查用户名和密码以及权限,然后再连接

2、本地连接,密码权限都对,但是无法连接

[root@slave162 mysql3311]# mysql -uroot -P3311  -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
错误原因:数据库本地连接默认使用的是/tmp/mysql.sock去连接数据库的,如果数据库的sock文件不是/tmp/mysql.sock&#x
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值