From passwordless to passworded root PDF Print E-mail
Written by Carl Friis-Hansen   
Sunday, 27 April 2008 19:29

In a terminal do the following whatever system you are running (Mac, Linux, Windows, Unix):

mysql -u root mysql
> DELETE FROM user WHERE Host='localhost' AND User='';
> QUIT;

mysqladmin reload
mysqladmin -u root password NEWPASSWORD

The case is that when you first install MySQL, local users can login without authentication. Secondly user root doesn't have a password, as this makes the installation easier and the user is guaranteed access.

Last Updated on Monday, 28 April 2008 01:18
 

Add comment

To be able to vote and have easier access to write comments, etc., go to Login and register yourself.
Your user name and email will never leave this website.


Security code
Refresh