MySQL root password change(MySQL 根密码更改)
问题描述
我一直在尝试重置我的 MySQL 根密码.我已经运行了 mysqld_safe --skip-grant-tables,更新了 root 密码,并检查了用户表以确保它在那里.
I have been trying to reset my MySQL root password. I have run mysqld_safe --skip-grant-tables, updated the root password, and checked the user table to make sure it is there.
重新启动 MySQL 守护程序后,我尝试使用我刚刚设置的新 root 密码登录,但仍然因用户root"错误而获得访问被拒绝.我也尝试过完全删除并重新安装 MySQL(包括删除 my.cnf 文件),但仍然没有运气.我接下来可以做什么?
Once restarting the MySQL daemon I tried logging in with the new root password that I just set and still get Access denied for user 'root' errors. I have also tried completely removing and reinstalling MySQL (including removing the my.cnf file) and still no luck. What can I do next?
推荐答案
我找到了!我更改密码时忘记对密码进行哈希处理.我用这个查询来解决我的问题:
I found it! I forgot to hash the password when I changed it. I used this query to solve my problem:
update user set password=PASSWORD('NEW PASSWORD') where user='root';
我忘记了 PASSWORD('NEW PASSWORD'),只是以纯文本形式输入新密码.
I forgot the PASSWORD('NEW PASSWORD') and just put in the new password in plain text.
这篇关于MySQL 根密码更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:MySQL 根密码更改
基础教程推荐
- 带更新的 sqlite CTE 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01
