ERROR 1045 (28000): Access denied for user 'root'@'192.168.6.122' (using password: YES) 从机连接主机报错
时间: 2023-09-08 12:14:16 浏览: 156
当从机连接主机时报错“ERROR 1045 (28000): Access denied for user 'root'@'192.168.6.122' (using password: YES)”,这意味着连接到主机的用户'root'在IP地址为192.168.6.122的从机上被拒绝访问。这通常是由于以下原因导致的:
1. 用户名或密码错误:请确保在从机上使用正确的用户名和密码尝试连接到主机。检查密码是否正确,并确保用户名和密码的大小写匹配。
2. 授权问题:在MySQL中,用户需要被授予从特定IP地址连接到主机的权限。请检查主机上的用户授权设置,确保允许来自192.168.6.122的用户'root'进行连接。可以使用GRANT语句授予权限,例如:
```
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.6.122' IDENTIFIED BY '密码' WITH GRANT OPTION;
```
3. 防火墙设置:检查主机和从机之间的网络连接是否正常,确保没有防火墙阻止主机和从机之间的连接。
如果您仍然遇到问题,请检查这些方面,并确保从机上的用户名、密码、授权和网络连接正确。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)](https://blog.csdn.net/quanqxj/article/details/103044530)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [连腾讯云上的docker上的mysql报错ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ ...](https://download.csdn.net/download/weixin_38732519/14074606)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文