Mysql Root Recovery — Simple way

Posted: November 23, 2014 in Freebsd, Mysql
Tags: , , , , , , , , ,

Assalamualaikum,

Aida saya dah jumpa cara senang nak recover root password utk freebsd @ Linux :
Step 1 = Stop mysql
 
Freebsd = /usr/local/rc.d/mysql-server stop
Ubuntu / Debian = /etc/init.d/mysql stop
 
Step 2 = start mysql data 
 
Freebsd : /usr/local/rc.d/mysql-server –skip-grant-tables &
Ubuntu / Debian = /usr/sbin/mysqld –skip-grant-tables –skip-networking &
 
Step 3 = Login Mysql
 
Freebsd = mysql -u root mysql
Ubuntu / Debian = mysql -u root
 
Step 4 : Change Password
 
** Utk root yg bleh access database online i.e.:  Muamalat
 
mysql> FLUSH PRIVILEGES;
mysql> UPDATE mysql.user SET Password=PASSWORD(‘newpwd’) WHERE User=‘root’;
 
** Utk Mysql biasa i.e: Arrahn
 
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR root@‘localhost’ = PASSWORD(‘password’);
 
Step 5 : kill mysql
 
killall mysqld 
 
issue command ni “ps aux | grep mysql”
dapatkan PID kemudian kill PID “killall PID”
 
CTH : 

msyamsuris-iMac:~ msyamsuri$ ps aux | grep mysql

msyamsuri        2866   0.0  0.0  2432772    664 s000  S+    8:08PM   0:00.00 grep mysql

2866 <– PID No

Step 6 : hidupkan semula mysql

Freebsd = /usr/local/rc.d/mysql-server strt
Ubuntu / Debian = /etc/init.d/mysql start

OK sekian utk Tutorial . 

** Email to mysq X-staff fine simple solutions for mysql root recovery.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s