jrri


1. 配置连接端mysql设置

vim /etc/mysql/mysql.conf.d/mysql.cnf


#更改mysql.conf文件第43行绑定地址为mysql主机的外网地址.

43  bind-address        = 192.168.0.1

 


2. 主机授权.


主机进入mysql. 输入授权命令

grant all privileges on 授权的数据库.数据库中的具体表 to \'连接端用户\'@\'连接端IP地址\' identified by \'连接端输入的密码\' with grant option;


例如:(授予IP-外网地址-为192.168.0.2下的root用户使用密码mypassword登录时,对mydatabase数据库下所有表格操作的权限.)

grant all privileges on mydatabase.* to \'root\'@\'192.168.0.2\' identified by \'mypassword\' with grant option; 


激活授权

flush privileges;

 

完成.

分类:

技术点:

相关文章:

  • 2021-10-16
  • 2021-11-14
  • 2021-12-03
  • 2022-01-03
  • 2021-11-17
  • 2021-11-17
  • 2021-12-29
  • 2021-11-17
猜你喜欢
  • 2021-11-07
  • 2021-06-19
  • 2021-11-17
  • 2021-10-16
  • 2021-12-15
相关资源
相似解决方案