由于配置好几次了,老是会忘记命令,所以记录下来

1.修改配置文件

我的配置文件是/etc/mysql/mysql.conf.d/mysqld.cnf

找到

bind-address = 127.0.0.1

注释掉

#bind-address = 127.0.0.1

2.为远程登录的用户赋予权限

这里是为root用户赋予的权限,也可以先为mysql添加用户

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

查看系统用户

use mysql;
select user,host from user;

mysql可以远程连接的配置

现在就可以使用远程数据库了

 

相关文章:

  • 2021-12-18
  • 2021-06-18
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-12-19
猜你喜欢
  • 2022-12-23
  • 2022-01-20
  • 2022-02-17
  • 2022-03-06
  • 2021-12-01
  • 2021-06-03
  • 2022-12-23
相关资源
相似解决方案