导入时我收到错误
Connection failed: SQLException: Access denied for user 'root'@'localhost' (using password: YES)
可能的解决办法是什么?
答案 0 :(得分:0)
以下是关于这个主题的笔记。我有同样的问题并保存这些笔记以备将来使用。我知道有两种创建用户和设置权限的方法 - 我希望它们有用。
mysql> select password('12345');
+-------------------------+
| password('123456') |
+-------------------------+
| 2ff898e158cd0311 |
+-------------------------+
1 row in set (0.00 sec)
mysql> create user test identified by password '2ff898e158cd0311';
A)预计@password为哈希字符串1值:
GRANT ALL PRIVILEGES
ON `mydb` . * TO 'username'@'localhost' IDENTIFIED
BY
PASSWORD '@password';
B)预计@password为明文字符串值:
GRANT ALL PRIVILEGES
ON `mydb` . * TO 'username'@'localhost' IDENTIFIED
BY '@password';