当前位置:Gxlcms > 数据库问题 > 七、数据库密码设置及修复

七、数据库密码设置及修复

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

一、设置数据库管理密码
mysqladmin -hlocalhost  -uroot   -p   password  "新密码"   
* 输入正确的旧密码新密码才能设置成功

使用新密码登陆   mysql  -uroot  -p654321

二、修复数据库管理员密码
service mysql stop
service mysql start --skip-grant-table
[root@svr5 mysql]# mysql
mysql> update mysql.user
    -> set  
    -> password=password("999")
    -> where
    -> user="root" and host="localhost";
mysql> flush privileges;
mysql> quit
service mysql stop
service mysql start
[root@svr5 mysql]# mysql   -uroot  -p999
mysql>

本文出自 “刘福” 博客,请务必保留此出处http://liufu1103.blog.51cto.com/9120722/1656831

七、数据库密码设置及修复

标签:数据库密码设置及修复

人气教程排行