当前位置:Gxlcms > 数据库问题 > 数据库忘记密码

数据库忘记密码

时间:2021-07-01 10:21:17 帮助过:12人阅读

[root@localhost]# mysql -uroot -p

Enter password:

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

root 密码忘记了。
解决思路:目前是进入不了数据库的情况,所以我们要考虑是不是可以跳过权限。因为在数据库中,MySQL 数据库中 user 表记录着我们用户的信息。

解决方法:启动 MySQL 数据库的过程中,可以这样执行:

/usr/local/mysql/bin/mysqld_safe –defaults-file=/etc/my.cnf  –skip-grant-tables &

这样启动,就可以不用输入密码,直接进入 MySQL 数据库了。然后在修改你自己想要改的 root 密码,然后重启 mysql。

update mysql.user set password=password(‘root123‘) where user=‘root‘;

#新密码为 root123

参考:
http://www.yunweipai.com/archives/22031.html

数据库忘记密码

标签:ble   hive   输入密码   权限   my.cnf   http   arch   tab   HERE   

人气教程排行