Home > Database > Mysql Tutorial > mysqlAccessdeniedforuser/'root/'@/&a_MySQL

mysqlAccessdeniedforuser/'root/'@/&a_MySQL

PHP中文网
Release: 2016-05-27 14:12:37
Original
1055 people have browsed it

mysqlAccessdeniedforuser/'root/'@/&a_MySQL

今天登录一台mysql服务器,输入mysql -u root -p 回车后,报错,错误消息如下:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Copy after login

我按照网上修改密码的方法进行操作,没有解决问题。

我又这样输入命令:

mysql -u root -p -h 127.0.0.1,
Copy after login

结果成功了,怀疑是主机权限问题

输入下面的命令, 不限制登录的主机,这样mysql -u root -p 就可以了

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
Copy after login

以上就是mysqlAccessdeniedforuser/'root/'@/&a_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template