简体   繁体   中英

com.mysql.jdbc.exceptions.jdbc4.MysqlSyntaxErrorException:Access denied for user "@'local host' to database 'mysql'

com.mysql.jdbc.exceptions.jdbc4.MysqlSyntaxErrorException:Access denied for user "@'local host' to database 'mysql'

This is my problem. I get this error every time I try to do the execution.

I have already tried this:

GRANT ALL PRIVILEGES 
ON GUEST_BOOK.* TO 'root'@'%' 
IDENTIFIED BY 'D7n()st1234' WITH GRANT OPTION;

您以“”用户身份连接(如零长度字符串),需要正确指定用户名

connection = DriverManager.getConnection(URL,USERNAME,PASSWORD); make sure the "USERNAME" and the "PASSWORD" is not forgetton

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM