Navicat远程管理Mysql数据库连接报错1045的解决办法

  • A+

每次在LINUX上安装好MYSQL数据库服务器后,利用Navicat管理时,总是提示下列错误:

navicat远程连接报错1045 access denied for user'root'@'ip'(using pasword:yes)

【解决办法如下】:

在本地或利用SSH登录mysql数据库,输入以下两条命令。

  1. GRANT ALL PRIVILEGES ON . TO'root'@'%' IDENTIFIED BY '' WITH GRANT OPTION;  
  2. flush privileges;  

注:这里*****表示数据库密码,在第二步中也可以通过重启数据库服务来实现。

具体操作如下示例:

  1. [root@ITCMDB ~]# mysql -u root -p  
  2. Enter password:   
  3. Welcome to the MySQL monitor.  Commands end with ; or \g.  
  4. Your MySQL connection id is 233  
  5. Server version: 5.7.22 MySQL Community Server (GPL)  
  6.   
  7. Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.  
  8.   
  9. Oracle is a registered trademark of Oracle Corporation and/or its  
  10. affiliates. Other names may be trademarks of their respective  
  11. owners.  
  12.   
  13. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  14.   
  15. mysql> GRANT ALL PRIVILEGES ON *.* TO'root'@'%' IDENTIFIED BY 'ABDd123469#' WITH GRANT OPTION;  
  16. Query OK, 0 rows affected, 1 warning (0.00 sec)  
  17.   
  18. mysql> flush privileges;  
  19. Query OK, 0 rows affected (0.00 sec)  
  20.   
  21. mysql>   
moonrong
  • 版权声明:本站原创文章,于2019年9月11日17:02:30,由 发表,共 1017 字。
  • 版权声明: 本文由于2019年9月11日17:02:30 发表在 好派笔记,共 1017 字。

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: