homeways

Ubuntu(kali)开启mysql远程连接

Linux 默认关闭mysql的远程连接,编辑 /etc/mysql/my.cnf 文件,

把里面的 bind-address = 127.0.0.1 改成 bind-address = 0.0.0.0,

然后重启mysql服务,输入命令: /etc/init.d/mysql restart ,

接下来,创建并赋予远程登录mysql的用户和权限,

授权格式:grant all privileges on 数据库.* to 用户名@localhost(ip) identified by \'密码\';

输入命令:grant all privileges on *.* to \'myuser\'@\'%\' identified by \'root\' with grant option;

如果myuser用户不存在,则默认创建myuser用户,*.* 为授予 myuser用户的所有权限,

\'myuser\'@\'%\' 为允许myuser从任何地方远程访问, root 为 myuser用户远程访问mysql数据库的密码,

最后刷新下表权限,输入命令:flush privileges;

结束。。。。。。

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-01-07
  • 2022-02-08
猜你喜欢
  • 2021-11-20
  • 2021-11-01
  • 2022-01-06
  • 2022-12-23
  • 2021-10-28
  • 2022-01-07
相关资源
相似解决方案