1登录到mysql中,为root进行远程访问的授权,所以主机都可以链接

GRANT ALL PRIVILEGES ON . TO 'root'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION;

修改生效
mysql>FLUSH PRIVILEGES

切换到 mysql DB
mysql> use mysql;

Database changed

查看现有用户,密码及允许连接的主机
mysql> select user,host from user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| debian-sys-maint | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+

2、进入/etc/mysql/mysql.conf.d 目录下的 mysqld.cnf 文件中需要把下面以上注释掉,使所以主机都可以链接
bind-address = 127.0.0.1

相关文章:

  • 2021-12-23
  • 2021-12-06
  • 2022-02-04
  • 2022-01-07
猜你喜欢
  • 2021-08-07
  • 2021-07-30
  • 2021-04-15
  • 2021-08-07
  • 2021-09-29
相关资源
相似解决方案