默认情况下Linux内的mysql数据库mysql,user表内的用户权限只是对localhost即本机才能登陆。需要更改权限:

mysql> Grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;(%表示是所有的外部机器,如果指定某一台机,就将%改为相应的机器名;‘root’则是指要使用的用户名,)

mysql> flush privileges;  (运行为句才生效,或者重启MySQL)

Query OK, 0 rows affected (0.03 sec)

查看用户的权限情况:

mysql>use mysql;

mysql> select host,user from user; 

| %                 | root   |(表面root可外部IP访问)

Thanks: http://blog.csdn.net/shunzi19860518/article/details/5057657

相关文章:

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