Langkah - langkah merecovery password root di database MySQL :
# /etc/init.d/mysql stop
Stopping MySQL database server: mysqld.
# mysqld_safe --skip-grant-tables &
[1] 674
# nohup: ignoring input and redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.67 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set password=PASSWORD("password") where User='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 3 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
# /etc/init.d/mysqld stop
STOPPING server from pid file /var/run/mysqld/mysqld.pid
090310 09:55:29 mysqld ended
Stopping MySQL: [ OK ]
[1]+ Done mysqld_safe --skip-grant-tables
# /etc/init.d/mysqld start
Starting MySQL: [ OK ]
Test konek menggunakan mysql client tanpa option password :# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Test konek menggunakan mysql client menggunakan option password :# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.67 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
Tidak ada komentar:
Posting Komentar