开始的时候错误是:1130 - Host'192.100.1.243' is not allowed to connect to this MySQL server,google到解决办法是在mysql下执行:grant all privileges on *.* to 'root'@'%' identified by 'rootpasswd' with grant option;
结果就开始报1045的错误。
我的mysql已启动(使用service mysqld status查看已是running状态),root已设置密码。
这种情况我该检查哪些方面呢?
7 个解决方案
#1
没有授权!
你的标题是 1045-Acess denied for user :'root'@'localhost'(Using password:YES)
你的标题是 1045-Acess denied for user :'root'@'localhost'(Using password:YES)
#2
试试
grant all privileges on *.* to 'root'@'localhost' identified by 'rootpasswd' with grant option;
再flush privileges;
grant all privileges on *.* to 'root'@'localhost' identified by 'rootpasswd' with grant option;
再flush privileges;
#3
还是不行啊!
#4
Navicat里主机写localhost呢?
#5
使用如下方法得到解决:
【
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
】
感谢iihero!!!
【
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
】
感谢iihero!!!
#6
我觉得是楼主某次密码不小心设置错了,之后一直用错了密码才导致这样
#1
没有授权!
你的标题是 1045-Acess denied for user :'root'@'localhost'(Using password:YES)
你的标题是 1045-Acess denied for user :'root'@'localhost'(Using password:YES)
#2
试试
grant all privileges on *.* to 'root'@'localhost' identified by 'rootpasswd' with grant option;
再flush privileges;
grant all privileges on *.* to 'root'@'localhost' identified by 'rootpasswd' with grant option;
再flush privileges;
#3
还是不行啊!
#4
Navicat里主机写localhost呢?
#5
使用如下方法得到解决:
【
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
】
感谢iihero!!!
【
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>
】
感谢iihero!!!
#6
我觉得是楼主某次密码不小心设置错了,之后一直用错了密码才导致这样
#7
同样的错误,通过这个帖子的方法解决了,
参考