Page 1 of 1

cannot log in as root after updating password in user db

PostPosted: 11. December 2009 18:27
by czimmer
I recently installed PHP and MySql using the xampp download.
The book I was trying to teach myself with stressed having the root user password protected so I entered the following:

mysql> update User
set password = 'my password'
where user = 'root';

mysql>flush privileges;

I then exited and tried to log back in as root using the new password

# mysql -u root -p
Enter password: **********

but now get the error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I appreciate any help on this.

Thanks

Re: cannot log in as root after updating password in user db

PostPosted: 11. December 2009 23:14
by Izzy
Missing support info - what XAMPP version and which Windows OS?

Run the \xampp\mysql\resetroot.bat file then try and access with no password.

If successful then create your password again and retry.

BTW you can also set the root user password from the Security menu item in http://localhost/index.php after running the above bat file to clear existing passwords.

Also you could use the MySQL GUI phpMyAdmin to create databases, users and user passwords and grant permissions all in a neat interface accessed by typing http://localhost/phpmyadmin in your browser.

More helpful reading for new XAMPP users:
\xampp\readme_en.txt file
or
http://www.apachefriends.org/winxampp/readme_en.txt
http://www.apachefriends.org/en/xampp-windows.html
http://www.apachefriends.org/en/faq-xampp-windows.html

Re: cannot log in as root after updating password in user db

PostPosted: 17. December 2009 17:29
by czimmer
thanks for that advice. resetroot.bat got rid of the password. :D

The links you gave to set the password did not bring up anything so I'll research this some more. I think for now I'll just not have a password.

Sorry it took so long for me to reply. I got sidetracked on other things for several days.