通过webmin锁定mysql db!

时间:2010-06-30 07:19:17

标签: sql mysql mysql-error-1044

[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锁定了!这就是我跑的一切!

1 个答案:

答案 0 :(得分:0)

如果您需要恢复的是MySQL root密码,请尝试以下方法:

http://www.cyberciti.biz/tips/recover-mysql-root-password.html

对于webmin密码,请尝试:

/usr/libexec/webmin/changepass.pl /etc/webmin admin foo

第二点:http://www.webmin.com/faq.html