Warning: Undefined variable $html in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 240

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/lib/plugins/tabinclude/helper.php:240) in /usr/share/nginx/html/inc/Action/Export.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /usr/share/nginx/html/lib/plugins/tabinclude/helper.php:240) in /usr/share/nginx/html/inc/Action/Export.php on line 106
mysql_rootpass

Resetting Mysql Root Password

  • One-Restart Version
  • Standard Practice Version

This is a quicker, less intrusive method with less downtime to reset mysql root password: Create the following file and then enter the command that follows

vim /var/lib/mysql/mysql.init

SET PASSWORD FOR 'root'@'localhost'=PASSWORD('mynewpassword');  

Now edit: /etc/my.cnf and enter the following under the [mysqld] block
init_file=/var/lib/mysql/mysql.init  

service mysqld restart  

mysql -u root -p  
Now delete the /var/lib/mysql/mysql.init and init_file=/var/lib/mysql/mysql.init line entered in /etc/my.cnf file

DONE