java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)

sql:

C:\>mysql -u root -p  
Enter password: ******  
Welcome to the MySQL monitor.  Commands end with ; or \g.  
Your MySQL connection id is 2  
Server version: 5.1.22-rc-community-log MySQL Community Server (GPL)  

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.  

mysql> grant all privileges on *.* to 'username'@'%' identified  by'password';  
Query OK, 0 rows affected (0.05 sec)  

mysql> flush privileges;  
Query OK, 0 rows affected (0.06 sec)  

mysql> exit  
Bye  

更好的解决还是更改用户名,不要用root为善。

阅读更多
个人分类: Mysql
上一篇从配置文件里读取数据,实现多数据库连接
下一篇web项目调试方法总结
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭