Set mysql root password after new installation on Linux

Set mySQL root password

If you install a fresh MySQL database server on Linux, the root account within MySQL has no password set yet.

To set the root password :

first login to your server using ssh as administrator privileges and  Issue the following command:

/usr/bin/mysqladmin -u root password ‘your-new-password’

“your-new-password” is the new desired password for root mysql username.

To test the new password just run the following command :

/usr/bin/mysql -u root -p
Enter password:


1,433 total views, 1 views today

Leave a Reply

Your email address will not be published. Required fields are marked *