You can issue the below commands to change the MYSQL root password
# /etc/init.d/mysqld stop
Start MYSQL server without password
# mysqld_safe --skip-grant-tables &
Connect MYSQL server using the following command
# mysql -u root
Then, you will get MYSQL prompt
mysql>
Then, we have to set up new MYSQL root Password
mysql> use mysql;
mysql> update user set password=PASSWORD(“newrootpassword”) where user=’root’;
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysqld stop
Then, connect to MYSQL database using new password
# mysql -u root -p
# /etc/init.d/mysqld stop
Start MYSQL server without password
# mysqld_safe --skip-grant-tables &
Connect MYSQL server using the following command
# mysql -u root
Then, you will get MYSQL prompt
mysql>
Then, we have to set up new MYSQL root Password
mysql> use mysql;
mysql> update user set password=PASSWORD(“newrootpassword”) where user=’root’;
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysqld stop
Then, connect to MYSQL database using new password
# mysql -u root -p
Comments
Post a Comment