Navicat远程连接数据库出现Access denied for user ‘root’@’%的’问题及解决
#问题:新安装的LAMP环境由于SSH管理较麻烦,因此想通过Navicat远程管理数据库,但连接时出现错误1045:Access denied for user ‘root’@’%。
#解决方法:首先明确出现这个问题是因为该用户无权限,因此应考虑对用户进行授权。
第一步:mysql -uroot -p123456’(此处是你的数据库登录密码,初始用户可无密码mysql -uroot -up直接进入,但若有密码请一定以密码进入否则将无数据库许多操作权限)
[root@VM-0-12-centos ~]# mysql -uroot -p123456;
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 229
Server version: 5.6.49-log Source distribution
Copyright (c) 2000, 2020, 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>