解决在Ubuntu上安装MySQL数据库但是不能远程连接问题描述Host '*' is not allowed to connect to this MySQL server

远程连接Ubuntu上的mysql

  • 打开命令窗口运行:mysql -u root - p
  • use mysql;
  • update user set host = “%” where user =“root”;
  • flush privileges;
  • select “host”,“user” from user where user=“root”;
  • 重启mysql服务

如果还是不可以可以尝试修改、sudo vim /etc/mysql/mysql.conf.d/ mysqld.cnf 注释掉 bind-address =127.0.0.1

发布了17 篇原创文章 · 获赞 1 · 访问量 559

猜你喜欢

转载自blog.csdn.net/a393007511/article/details/103851818