在我的php我的管理员,密码已更改并在ubuntu 12.04中标记为AllowNoPassword

时间:2014-01-08 12:57:28

标签: mysql phpmyadmin ubuntu-12.04

在我的php中,我的管理员(mysql)是一个密码,但我更改了它并在ubuntu12.04中标记了AllowNoPassword。

之后我无法输入我的phpmyadin它显示“配置禁止无密码登录(请参阅AllowNoPassword)”。

请帮助我如何访问我的mysql数据或更改我的密码。

4 个答案:

答案 0 :(得分:0)

你的配置中应该有以下几行

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = true;

link

使用此命令停止mysql恶魔进程:

 sudo /etc/init.d/mysql stop

使用带有此命令的--skip-grant-tables选项启动mysqld恶魔进程

sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

因为此时您没有检查用户权限,所以禁用网络是最安全的。在Dapper中,/ usr / bin / mysqld ...没有用。但是,mysqld --skip-grant-tables确实如此。

使用此命令启动mysql客户端进程

 mysql -u root

从mysql提示符执行此命令以便能够更改任何密码

FLUSH PRIVILEGES;

然后重置/更新密码

SET PASSWORD FOR root@'localhost' = PASSWORD('password');

如果你有一个可以从任何地方连接的mysql root帐户,你也应该这样做:

UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';

link

答案 1 :(得分:0)

You can run following command from the terminal for changing the user password:-

mysqladmin -u root -p PASSWORD YOUR_NEW_PASSWORD 

Press Enter
It will ask for current password 
Give current password there
Done

答案 2 :(得分:0)

TQ,好的,问题解决了。 为此,我使用了一个命令,对于你我在下面提到了它:

**停止MySQL服务器。

sudo /etc/init.d/mysql stop

启动mysqld配置。

sudo mysqld --skip-grant-tables&

以root身份登录MySQL。

mysql -u root mysql

用新密码替换YOURNEWPASSWORD!

UPDATE用户SET密码= PASSWORD('YOURNEWPASSWORD')WHERE User ='root'; FLUSH特权;出口;

**

答案 3 :(得分:0)

问题解决了。为此,我使用了一个命令,对于你我在下面提到了它:

Stop the MySQL Server.

sudo /etc/init.d/mysql stop

Start the mysqld configuration.

sudo mysqld --skip-grant-tables &

Login to MySQL as root.

mysql -u root mysql

Replace YOURNEWPASSWORD with your new password!

UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;