Home Contact Sitemap

WAHIL.net

Professional Linux consultancy, support and documentation.

MySQL configuration and management

How to set up the MySQL root password?
In the MySQL command prompt space, execute: update user set Password=PASSWORD(’new-password’) where user=’root’;

Then: flush privileges;

Now, quit;

Try to log in: mysql

Oh! You can’t log in as done before. It is a normal situation. In order to log in again to the MySQL database server, excute:

mysql -u root -p

Then, enter your password and your back in again.

However, to use the “root” MySQL account for most usage is not a good advice. In contrast, you can give a user (of MySQL) certain privileges on the management of any number of databases. For example: To give permission usage and database management to the user “sky” in the database “jet”, do it:

GRANT select, insert, update, create, alter, delete, drop ON jet.* TO sky@localhost IDENTIFIED BY ‘password_of_the_user:_sky’;

These database privileges applies in the localhost.

Posted on November 2008 in Database