CentOS navicat 连接mysql时报错1045

问题描述:

1045-Access denied for user 'root'@'localhost'(using password: YES)

方法:

操作系统为CentOS系列

注意:一定要重启mysql服务或者重启服务器

1、针对一对一用户

# mysql -uroot -p
MySQL [(none)]> grant all privileges on db_name.* to [email protected]’%’ identified by ‘db_pass’; #授权语句,特别注意有分号
MySQL [(none)]> flush privileges;
MySQL [(none)]> exit; #退出数据库控制台,特别注意有分号

重启MYSQL:service mysqld restart

2、针对总帐号root  即一个帐号管理所有数据库

grant all privileges on * to [email protected]’%’ identified by ‘dsfdfggdg41;

CentOS navicat 连接mysql时报错1045

引用:https://oneinstack.com/docs/lnmpstack-image-guide/ 

如何配置MySQL远程连接  >> 3. 数据库授权

 

 

 

相关文章:

  • 2021-04-14
  • 2022-12-23
  • 2021-10-29
  • 2021-06-15
  • 2021-09-10
  • 2021-04-10
  • 2021-07-14
  • 2021-04-05
猜你喜欢
  • 2021-07-11
  • 2021-06-03
  • 2022-12-23
  • 2021-06-18
  • 2021-05-17
  • 2021-12-06
相关资源
相似解决方案