1396 - Operation ALTER USER failed for 'root'@'localhost'
时间: 2023-09-10 14:13:25 浏览: 204
南大通用GBase8s SQL常用SQL语句(二十九).docx
139 - Operation ALTER USER failed for 'root'@'localhost'是MySQL数据库中的错误代码,表示在尝试更改用户'root'@'localhost'的属性时发生了错误。
解决这个问题的方法如下:
1. 首先,您可以检查MySQL数据库中的user表中用户'root'的plugin字段。可以使用以下命令查看:select host,user,plugin from user;
2. 如果发现用户'root'的plugin字段不是'mysql_native_password',您可以尝试以下操作:
a. 进入MySQL数据库,可以使用以下命令:mysql -u root -p
b. 执行以下命令来修改密码并将plugin字段设置为'mysql_native_password':ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_password';
c. 将'your_new_password'替换为您想要设置的新密码。
3. 如果用户'root'不存在,您可以尝试创建一个新的'root'用户,并按照上述步骤设置密码和plugin字段。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [MySQL修改密码报错ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost](https://blog.csdn.net/u012069313/article/details/123051399)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [[phpMyAdmin]ERROR 1396 (HY000): Operation ALTER USER failed for ‘root‘@‘localhost‘解决](https://blog.csdn.net/W_Think/article/details/128646752)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文