1. mysql -u root -p;     // 登录mysql, 并输入密码

2. use mysql;             // 打开 mysql 数据库

3. update user set host='%' where user='root' and host='localhost';     // 允许远程登录

   update user set host='localhost' where user='root';  //  禁止远程登录

4. flush privileges;    //刷新权限表,使配置生效

5. service mysqld restart  // 重启mysql服务

相关文章:

  • 2021-12-10
猜你喜欢
  • 2021-12-19
  • 2021-12-19
  • 2021-11-26
  • 2022-01-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案