Senin, 31 Oktober 2011

Mysql Root Password Recovery

berikut ini adalah langkah-langakah recovery root password pada mysql-server. tulisan ini adalah terjemahan dari artikel yang dimuat oleh www.cyberciti.biz

Langkah # 1 : Matikan service mysql

# /etc/init.d/mysql stop

Output:
Stopping MySQL database server: mysqld.

Langkah # 2: Jalankan MySQL server tanpa password atau safe mode:

# mysqld_safe --skip-grant-tables &

Output:
[1] 5988
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[6025]: started

Langkah # 3: konek ke mysql server dengan mysql client:

# mysql -u root

Output:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.
mysql>

Langkah # 4: Setup password root MySQL :

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

Langkah # 5: Matikan MySQL Server:

# /etc/init.d/mysql stop

Output:

Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+ Done mysqld_safe –skip-grant-tables

Langkah # 6: Jalankan MySQL server dan coba apakah password berhasil diganti:

# /etc/init.d/mysql start
# mysql -u root -p
Read More..
za.IPAN's Blog © 2008. Design by :Yanku Templates Sponsored by: Tutorial87 Commentcute