.... အားလံုးအတြက္ မဟုတ္ခဲ့ရင္ေတာင္ တစ္စံုတစ္ရာ တစ္စံုတစ္ေယာက္အတြက္ ေႏြးေထြးတဲ့ ေကာင္းကင္ငယ္ေလး ျဖစ္ပါရေစ ....

Monday, January 7, 2013

Forgot password Or Recover MySQL Root Password


MySQL root Password ပတ္စ္၀ါဒ့္ေမ့သြားတဲ့အခါျပန္ျပီးေခၚရေအာင္ ျပင္ရေအာင္
အဆင့္ ငါးဆင့္နဲ႔ သြားလိုက္ရေအာင္
ပထမ mysql ကို stop လိုက္ပါမယ္
# /etc/init.d/mysql stop

ဒုတိယ ကေတာ့ sql ထဲကို၀င္ဖို႔အတြက္ table grant ကို ေက်ာ္မယ့္အဆင့္ပါ
# mysqld_safe --skip-grant-tables &

တတိယ ကေတာ့ sql server ထဲကို၀င္ပါမယ္
# mysql -u root

ေရာက္သြားျပီဆိုရင္ ေအာ္ကမွာေပးထားတဲ့အတိုင္း ပါတ္စ္၀ါဒ္ခ်ိန္းပါ့မယ္
mysql>
mysql> use mysql;
mysql> update user set password=PASSWORD("YOUR_PASSWDအသစ္ေပးမယ့္ ပတ္စ္၀ါဒ့္") where User='root';
mysql> flush privileges;
mysql> quit

အဲဒါျပီးရင္ေတာ့ ျပန္၀င္ၾကည့္ရေအာင္
# 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.1.66 Source distribution

Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

ေနာက္ဆံုးေတာ့ sql ေလးျပန္ start ေပးထားလိုက္တာေပါ့ ..

# /etc/init.d/mysql start

0 မွတ္ခ်က္: