Reset root password MySQL But mysqld_safe: unrecognized service

From google search about many how to reset. on step start mysqld_safe has message "mysqld_safe: unrecognized service"

I don't know error. maybe unknow  mysqld_safe command    can you check  mysqld_safe path

#ps -aux | grep mysql

Output line
root      2579  0.0  0.0 106100  1356 pts/0    S    11:27   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql   bra bra bra ....

This path /usr/bin/mysqld_safe

Step 1 stop mysql service

# /etc/init.d/mysql stop


step 2  run to safe mode

#mysqld_safe --skip-grant-tables & 

Yep! this one  mysqld_safe: unrecognized service  I replace command is

/usr/bin/mysqld_safe --skip-grant-tables &

Work!  mysqld_safe it runing

step 3 login root with out password

#mysql -u root

step 4 update root password

mysql> use mysql;
mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
mysql> flush privileges;
mysql> quit

step 5 stop start restart and login new password

# /etc/init.d/mysql start
# mysql -u root -p

Test on mysql-5.1.73-3 ,CentOS 6.5

if you want eCommerce let's go KhonkaenSOFT.com HAHAHA




Comments