1. Modify MySQL Logon Settings:
# Vi/etc/my. cnf adds the following sentence to the [mysqld] section: skip-grant-tables for example: [mysqld] datadir =/var/lib/mysqlsocket =/var/lib/mysql. save sockskip-grant-tables and exit vi. 2. restart mysqld #/etc/init. d/mysql restartStopping MySQL: [OK] Starting MySQL: [OK] 3. log on to and modify the MySQL root Password #/usr/bin/mysqlWelcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 3 to server version: 3.23.56Type 'help; 'or' \ H' for help. type '\ C' to clear the buffer. mysql> USE mysql; Reading table information for completion of table and column namesYou can turn off this feat Ure to get a quicker startup with-ADatabase changedmysql> UPDATE user SET Password = password ('new-password') WHERE User = 'root'; Query OK, 0 rows affected (0.00 sec) Rows matched: 2 Changed: 0 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.01 sec) mysql> quitBye4. modify the MySQL Logon Settings # vi/etc/my. cnf deletes and saves the skip-grant-tables added to the [mysqld] segment and exits vi. 5. Restart mysqld #/etc/init. d/mysql restartStopping MySQL: [OK] Starting MySQL: [OK]