How to Change or Set New Root Password for Mysql Database

How to Change or Set New Root Password for Mysql Database

For Mysql database, the system administrator user is called as root user. You can use the mysqladmin utility from a command line to change or set to a new password. Notice that there are two commands to be run.


mysqladmin -u root password "newpassword"
mysqladmin -u root -h host_name password "newpassword"

Mysql Set New password example:

mysqladmin -u root password ghtrj23%nh&
mysqladmin -u root -h localhost password ghtrj23%nh&

Run the below command to restart your Mysql database server to take effect for the password change. the next time you login it will prompt for you the New Password

Mysql Database Restart Command
sudo /etc/init.d/mysql restart


Related Topic How to Reset and Set Mysql Password on Ubuntu
Change MySQL Root Password
List of Mysql Error Code and Description
How to Create Datasource in JBoss
How to use Datasource in Hibernate
SQL  mysql  database  

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback