Selasa, Oktober 19, 2010

Reset Root Password on MySQL

Penulis Day Milovich | Selasa, Oktober 19, 2010 | 11.30.00 |

Reset Root Password on MySQL is easy!

1. First, you have to turn off the server, the server did not mean a whole but only mysql service

# /etc/init.d/mysql stop


2. then create a sql script to change the password with the command

# vi /root/mysql.reset.sql


or with other commands you like such as pico or nano.

write or fill in the following script:

mysql.user UPDATE SET Password = PASSWORD ( 'my_password') WHERE User = 'root';
GRANT ALL ON *.* TO 'root';
FLUSH PRIVILEGES;


Save it

3. sql script is run with the command:

# mysqld_safe --init-file=/root/mysql.reset.sql &


do not forget the "&" (ampersand) in the script

then there will be output:

nohup: ignoring input and redirecting stderr to stdout

Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[20970]: started

4. restart mysql server

# /etc/init.d/mysql start


;p

---
Day Milovich,,
http://facebook.com/daymilovich
http://daymilovich.blogspot.com

Tidak ada komentar:

Posting Komentar

Anda bisa berkomentar tanpa perlu login.

 
Day Milovich (c) 2013. Diberdayakan oleh Blogger.