gpt4 book ai didi

mysql - 当我尝试连接 mysql 服务器时访问被拒绝

转载 作者:行者123 更新时间:2023-11-29 22:21:05 25 4
gpt4 key购买 nike

我正在尝试使用查询浏览器连接到 MySQL 服务器。但是,我在 Windows 命令提示符中收到以下错误消息 主机不允许连接此 MySQL 服务器实例 我尝试了所有方法在 STACK OVERFLOW like-GRANT 命令中建议,然后尝试访问。这可能是一个“重复”的问题。但请回答我。

 Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Admin>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 211
Server version: 5.0.95-community-nt MySQL Community Edition (GPL)

Copyright (c) 2000, 2011, 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 ON *.* TO 'root'@'123.28.88.45' WITH GRANT OPTION;
ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: NO)
mysql> GRANT ALL ON *.* TO 'root'@'123.28.88.45' WITH GRANT OPTION
-> FLUSH PRIVILEGES
-> mysql -u root -p
-> \q

最佳答案

尝试使用mysql -uroot -p而不是mysql登录。您的最后一个 Grant-Command 失败,因为您错过了一个分号。

BR克里斯

关于mysql - 当我尝试连接 mysql 服务器时访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30706037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com