程序在连接远程 mysql服务器时出错 java.sql.SQLException: Access denied for user 'root'@'192.168.27.129' (using password: YES)

本机IP为'192.168.27.129'

进入mysql命令行:

MySQL>use mysql;

MySQL>select host,user from user;

查看得信息如下,也没有限制不让本机连接mysql呢。

 

+-----------------------+------+
| host                  | user |
+-----------------------+------+
| %                     | root |
| 127.0.0.1             | root |
| ::1                   | root |
| localhost             | root |
| localhost.localdomain | root |
+-----------------------+------+

 

难道是默认不让root远程登陆??

MySQL>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xuxu' WITH GRANT OPTION

予任何主机访问数据的权限

3、MySQL>FLUSH PRIVILEGES

 程序再用root和密码 ,登录,结果成功!

 

相关文章:

  • 2022-12-23
  • 2021-05-14
  • 2021-10-03
  • 2021-08-05
  • 2021-09-14
  • 2021-09-12
  • 2021-07-22
  • 2021-07-31
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2021-05-06
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案