Hi all,
I have just installed MySQL  recently. I already set the root password and
some databases testing and everything worked fine. However, I accidentally
changed the root to anonymous yesterday. After that, I couldn't add new
users and do some administration tasks even change password myself.

 In the website: http://www.bitbybit.dk/mysqlfaq/faq.html , I found FAQ to
try to solve my problem.

I quote the instruction as follows:-
------------
reset the root password?
The following procedure will help you reset the root password. Note that
while you are doing this, the server is totally open and gives everybody
full access to all databases.

Stop the server
Restart the server with the command-line option -Sg or --skip-grant-tables
You can now log in to the server without a password. So can anyone else!
Reset the root password with the command
mysql -> GRANT ALL PRIVILEGES ON *.* TO "root"@"localhost"
      -> IDENTIFIED BY "the_new_password"

Exit the client
Immediately thereafter, shut down and restart the server as usual.
----------------------------

However, I tried many times. I found only if I restart the server
with --skip-grant-tables option, the server will promt out "ERROR 1047:
Unknown Command" when I type "GRANT ALL PRIVILEGES ON *.* TO
"root"@"localhost" IDENTIFIED BY "the_new_password";


Here is my option file /etc/my.cnf:

[mysqld]
user=root
datadir=/var/lib/mysql
socket=/var/lib/mysql.sock
skip-grant-tables

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err_log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
---------end of file

I don't know whether the my.cnf is correct or not. Please let me. Thanks for
any help or advise.




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to