[root@cp ~]# mysql> CREATE DATABASE foo;
[root@cp ~]# mysql> GRANT ALL ON foo.* TO root@'my home ip' IDENTIFIED BY 'aron1252';
[root@cp ~]# mysql> update user set Host='my home ip' where user='webadmin';
[root@cp ~]# GRANT ALL ON foo.* TO root@'localhost' IDENTIFIED BY 'newpass';
-bash: GRANT: command not found
[root@cp ~]# mysql> GRANT ALL ON foo.* TO root@'localhost' IDENTIFIED BY 'newpass';
[root@cp ~]# mysql> update user set Host='localhost' where user='webadmin';
[root@cp ~]# UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
-bash: syntax error near unexpected token `('
[root@cp ~]# UPDATE mysql.user SET Password=newpass WHERE User='root';
-bash: UPDATE: command not found
[root@cp ~]# mysql> UPDATE mysql.user SET Password=newpass WHERE User='root';
[root@cp ~]# mysql>FLUSH PRIVILEGES;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'PRIVILEGES'
[root@cp ~]# mysql -u root p- newpass
我在尝试启用远程ip后得到了锁定,我的shell仍然打开,我可以从putty访问它,但我从webmin锁定了!这就是我跑的一切!
答案 0 :(得分:0)
如果您需要恢复的是MySQL root密码,请尝试以下方法:
http://www.cyberciti.biz/tips/recover-mysql-root-password.html
对于webmin密码,请尝试:
/usr/libexec/webmin/changepass.pl /etc/webmin admin foo