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

来源:互联网 发布:淘宝运营教程视频下载 编辑:程序博客网 时间:2024/05/19 20:37

sql:

[sql] view plaincopy
  1. C:\>mysql -u root -p    
  2. Enter password: ******    
  3. Welcome to the MySQL monitor.  Commands end with ; or \g.    
  4. Your MySQL connection id is 2    
  5. Server version: 5.1.22-rc-community-log MySQL Community Server (GPL)    
  6.   
  7. Type 'help;' or '\h' for help. Type '\c' to clear the buffer.    
  8.   
  9. mysql> grant all privileges on *.* to 'username'@'%' identified  by'password';    
  10. Query OK, 0 rows affected (0.05 sec)    
  11.   
  12. mysql> flush privileges;    
  13. Query OK, 0 rows affected (0.06 sec)    
  14.   
  15. mysql> exit    
  16. Bye