Mysql Workbench 连接Ubuntu上的Mysql时报如下错误:

MySQL 远程连接问题 (Linux Server)

 

原因:查看  /etc/mysql/mysql.conf.d/mysqld.cnf

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1

默认只支持本地访问。

 

修改为:

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 0.0.0.0

 

然后重启Mysql :

service mysql restart

 

再重新连接报如下错误:

MySQL 远程连接问题 (Linux Server)

 

查找原因:

 MySQL 远程连接问题 (Linux Server)

显示只能localhost 访问。

解决方法:修改授权远程访问

 

修改:

mysql> update user set host="%" where user="root";

或新增:

grant all privileges on *.* to 'root'@'%'  identified by 'admin123' with grant option;
flush privileges;

%代表通配,也可换成IP地址。

 

相关文章:

  • 2022-03-08
  • 2021-05-30
  • 2022-12-23
  • 2022-01-01
  • 2022-01-06
  • 2022-12-23
  • 2021-12-14
  • 2022-02-24
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-12-14
  • 2021-04-21
  • 2021-05-23
相关资源
相似解决方案