Franck ABELLI writes:
> To change the root password i connected to mysql: bin/mysql
> mysql>connect mysql localhost
> mysql>UPDATE user set Password='***' where User='root';
> ->No problems
> mysql>SELECT User,Password FROM user;
> -> to verify if the pass was set... it was.
>
> then i stopped mysql and restart it and it was impossible connecting
> again. here is the detailed result :
>
> Linux>bin/mysql -u root -p
> Enter password : ****
> mysql >use mysql
> Database changed
> mysql>SELECT * FROM user;
> ERROR 1044:Access Denied for user: '@localhost' to database 'mysql'
> ERROR:
> can't connect to the server
>
>
> sure,i made mistakes, but now how can i recover my Mysql ?
Hi!
If you are going to go about setting the password in this fashion,
then you need to make sure to use the password() function in your
UPDATE statement. For example:
UPDATE user set Password=password('***') where User='root';
To connect to your server in it's current state (with bad root passwd)
you need to start mysqld with the '--skip-grant-tables' option.
In the future, instead of restarting the mysql daemon for changes to
the grant tables to take effect, check out 'FLUSH PRIVILEGES'.
http://www.mysql.com/manual.php?section=FLUSH
Regards,
Matt
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Matt Wagner <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, http://www.mysql.com/
/_/ /_/\_, /___/\___\_\___/ River Falls, Wisconsin, USA
<___/ Developer
---------------------------------------------------------------------
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