欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql使用localhost可以访问,使用ip地址无法访问

程序员文章站 2022-07-15 16:04:30
...

亲测有效

  • 命令行登录数据库:mysql -uroot -p
    mysql使用localhost可以访问,使用ip地址无法访问
  • 查看用户:select host,user from mysql.user;
    mysql使用localhost可以访问,使用ip地址无法访问
  • 设置允许任意IP访问,执行语句:update mysql.user set host = '%' where user = 'root';
    mysql使用localhost可以访问,使用ip地址无法访问
flush privileges;

mysql使用localhost可以访问,使用ip地址无法访问

  • 使用客户端工具连接测试:连接成功
    mysql使用localhost可以访问,使用ip地址无法访问
相关标签: mysql