比那米重置mysql root pwd [英] Bitnami. reset mysql root pwd

查看:52
本文介绍了比那米重置mysql root pwd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在MySQL中重置root pwd和帐户,如我所遵循的说明如何授予其他服务器的特权以及将root用户(Mysql)意外绑定到其他IP地址,现在看来我无法以管理员身份登录在本地主机上?

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?

谢谢

推荐答案

您有3种方法可以在mysql中重置rootpass:

1 -启动以下命令:

sudo服务mysql重置密码

2 -您也可以尝试:

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


3 -第三种解决方案更长一些,但对我有用:


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`

您现在已绕过特权连接到mysql.

You're now connected to mysql bypassing privileges.

USE mysql;

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

您的根通行证现在应该重置.只需退出mysql clt并重新启动mysql服务即可:

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

quit

sudo mysqladmin shutdown

sudo service mysql start

这篇关于比那米重置mysql root pwd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆