Alex,
Thursday, March 07, 2002, 7:18:13 PM, you wrote:

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

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

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

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

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

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

If you start mysqld with --skip-grant-tables option you should execute
"FLUSH PRIVILEGES" command _before_ using GRANT statement.
It is covered in the manual, look at:
   http://www.mysql.com/doc/R/e/Resetting_permissions.html





-- 
For technical support contracts, goto https://order.mysql.com/
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
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