欢迎光临
我们一直在努力

修改mysql数据库密码

1) Make sure the root mysql password works.  If you know it, skip to 2). The mysql root password can be found in the /usr/local/directadmin/scripts/setup.txt if it has not been deleted.  It’s under the header “mysql=”.  If it cannot be found, then mysqld will have to be restarted with the –skip-grant-tables option (this guide is for Redhat/CentOS):

/etc/init.d/mysqld stop
mysqld_safe –skip-grant-tables &

That should start up mysql without the need for a root password.  Once in, type

use mysql
UPDATE mysql.user SET password=PASSWORD(‘1OycBr740l‘) WHERE user=’root’;
FLUSH PRIVILEGES;
quit

That will reset the root password for you.

Type “killall -9 mysqld_safe; killall -9 mysqld” to shut down mysqld.
Start it up again with

/etc/init.d/mysqld start

 

赞(0) 打赏
未经允许不得转载:优惠吧 » 修改mysql数据库密码
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!