最新消息:20210917 已从crifan.com换到crifan.org

【已解决】新建mysql用户无法访问数据库:ERROR 1045 (28000): Access denied for user ‘runningfast’@’localhost’ (using password: YES)

MySQL crifan 3406浏览 0评论

折腾:

【已解决】Sequel Pro连接mysql数据库出错:MySQL said: Host is not allowed to connect to this MySQL server

期间,新建的mysql的用户,结果无法登录

(RunningFast) ➜  RunningFast mysql -u runningfast -p
Enter password: 
ERROR 1045 (28000): Access denied for user ‘runningfast’@’localhost’ (using password: YES)

ERROR 1045 (28000): Access denied for user localhost (using password: YES)

MySQL ERROR 1045 (28000): Access denied for user ‘bill’@’localhost’ (using password: YES) – Stack Overflow

(RunningFast) ➜  RunningFast mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 620
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql> grant all privileges on *.* to runningfast@localhost identified by ‘Jiandao123’ with grant option;
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye

然后的确可以了:

(RunningFast) ➜  RunningFast mysql -u runningfast -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 622
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>

【总结】

之前在Mysql中用

grant select,insert,update,delete,create,drop,alter,index on runningfast_dev.* to ‘runningfast’@’115.29.173.126’ identified by ‘Jiandao123’;

创建了新的用户,且权限显示也OK了。

但是结果却无法登录:

ERROR 1045 (28000): Access denied for user ‘runningfast’@’localhost’ (using password: YES)

最后用:

root用户登录进去:

mysql -u root -p

然后去赋给所有权限:

grant all privileges on *.* to runningfast@localhost identified by ‘Jiandao123’ with grant option;

即可。

转载请注明:在路上 » 【已解决】新建mysql用户无法访问数据库:ERROR 1045 (28000): Access denied for user ‘runningfast’@’localhost’ (using password: YES)

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
92 queries in 0.180 seconds, using 23.34MB memory