Bitnami. reset mysql root pwd

一个人想着一个人 提交于 2021-02-10 09:40:13

问题


How do I reset the root pwd and account in MySQL as I was following instructions how to grant priveledges for other servers and accidently tied root user (Mysql) to other ip address and now it seems that I can not log in as admin on localhost?

Thanks


回答1:


You have 3 ways to reset rootpass in mysql:

1 - launch the following command:

sudo service mysql reset-password


2 - You can also try:

`sudo dpkg-reconfigure mysql-server-x.x`

3 - The third solution is a bit longer but worked for me:

`sudo service mysql stop`

`sudo /usr/bin/mysqld_safe --skip-grant-tables & mysql -h localhost`

You're now connected to mysql bypassing privileges.

USE mysql;

UPDATE USER
SET    password = password('<your_new_pass>')
WHERE  USER = 'root' AND host = 'localhost';

Your root pass should be resetted now. just quit mysql clt and restart mysql service:

quit

sudo mysqladmin shutdown

sudo service mysql start


来源:https://stackoverflow.com/questions/24061869/bitnami-reset-mysql-root-pwd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!