Navicat access denied for user root@
时间: 2023-09-20 07:14:38 浏览: 138
mysql8重置root用户密码的完整步骤
引用中提到,可能是由于你的账号不允许从远程登录,只能在localhost本地登录数据库。解决这个问题的方法之一是在数据库搭建时,创建一个允许远程连接的用户,或者将数据库中的"user"表中的"root"用户的登录方式从localhost改为%(即允许任何主机连接)。给出了一个具体的方法,通过在MySQL命令行中输入以下命令来授权root用户允许任何主机访问数据库:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '数据库密码' WITH GRANT OPTION;提供了两种不同版本MySQL修改root密码的方法。对于MySQL 8.0之前的版本,可以使用以下命令修改root密码:
UPDATE mysql.user SET authentication_string = PASSWORD('你的密码') WHERE user = 'root';<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [Navicat连接MySQL时弹出:1045:Access denied for user ‘root’@’localhost’](https://blog.csdn.net/qq_42392049/article/details/118480346)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Navicat报错:1045-Access denied for user root@localhost(using password:YES)怎么解决(超实用,亲测有效...](https://blog.csdn.net/weixin_54040016/article/details/128192083)[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^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文