报错:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
注意mysql才安装的时候默认无密码登陆,所以开始报错为:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: no)
但是修改了/etc/my.cnf
[client]
password = 123 #这里随便写了个客户端登陆密码
port = 3306
socket = /tmp/mysql.sock
结果 没卵用照样报错,如下:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
密码有了的报错,
但是注意这里的报错是访问被拒绝,这就让我想到了跟权限相关的配置,而且在mysql服务器下的配置也就是在
[mysqld]
后边的这些配置,加上skip-grant-tables这条,如下:
[mysqld]
skip-grant-tables
port = 3306
socket = /tmp/mysql.sock
datadir = /www/server/data