Pejman Moghadam / General

MySQL password recovery

Public Domain


/var/lib/mysql/mysql-pass-recover

UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root';
FLUSH PRIVILEGES;

Restart mysql with new init file

chown mysql:mysql /var/lib/mysql/mysql-pass-recover
/etc/rc.d/rc.mysqld stop
sleep 5
killall mysqld; killall mysqld; killall mysqld; killall mysqld;
sleep 5
mysqld_safe --init-file=/var/lib/mysql/mysql-pass-recover &
sleep 5
killall mysqld; killall mysqld; killall mysqld; killall mysqld;
sleep 5
/etc/rc.d/rc.mysqld start

BY: Pejman Moghadam
TAG: mysql, password-recovery
DATE: 2014-01-18 18:00:40


Pejman Moghadam / General [ TXT ]