You can recover a MySQL database server password with the following five easy steps:
Step # 1 : Stop the MySQL service:
# /etc/init.d/mysqld stop
Step # 2: Start the MySQL server w/o password:
You can recover a MySQL database server password with the following five easy steps:
Step # 1 : Stop the MySQL service:
# /etc/init.d/mysqld stop
Step # 2: Start the MySQL server w/o password:
If you have never set a root password for MySQL, the server does not require a password at all for connecting as root. To set up a root password for the first time, use the mysqladmin command at the shell prompt as follows:
$ mysqladmin -u root password ‘newpassword’
If you want to changeĀ a root password, then you need to use the following command: