用户名和密码都正确,总是出现下面问题,谁可以帮忙解决啊,谢谢
Could not obtain connection to query metadata : Access denied for user ''@'localhost' (using password: YES)
Could not obtain connection to query metadata : Access denied for user ''@'localhost' (using password: YES)
1,驱动配置有误:driver=com.MySQL.jdbc.Driver
2,数据库连接地址有误:url=jdbc:mysql://localhost:3306/test?3useUnicode=true&characterEncoding=utf8
3,密码或帐号有误:username=root password=root
4,数据库未启动或无权访问
5,项目未引入对应的驱动jar包mysql-connector-Java-5.x.x-bin.jar
6,mysql root没有远程访问的权限,需要增加权限,增加权限的步骤如下:
进入mysql数据库:
grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
flush privileges;
举报