MySQL root password Recovery

Merhabalar ;

oncelikle mysql in kostugu server uzerinde administrative haklara ihtiyacimiz oldugunu hatirlatirim

sonrasinda MySQL servislerini kapatmamiz yada oldurmemiz gerekmekte.

[root@cehturk ~]# killall -9 mysqld_safe
[root@cehturk ~]# killall -9 mysqld

daha sonra MySQL server'i kullanici ve sifre sormayacak sekilde calistiracagiz ( this is the magic ! :P )

[root@cehturk ~]# which mysqld_safe
/usr/bin/mysqld_safe

[root@cehturk ~]# /usr/bin/mysqld_safe --skip-grant-tables &

evet yolun yarisini tamamladik artik MySQL server'a root olarak baglanabiliriz

[root@cehturk ~]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.45 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

simdi olaya girisiyoruz

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('yenisifre') WHERE user='root';
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

[root@cehturk ~]#

evet hepsi bu kadar artik root sifresini yenisifre olarak degistirdik simdi yapmamiz gereken teksey
MySQL i suanki "magic" durumunda kapatip sonra MySQL servisini duzgun bir sekilde calistirmak.
redhat , centos , debian ve ubuntu icin bunu soyle yapabiliriz

[root@cehturk ~]# /etc/init.d/mysqld restart
Stopping MySQL:                                            [  OK  ]
Starting MySQL:                                            [  OK  ]
[root@cehturk ~]#

hepsi bu kadar gecmis olsun :)

__________________________
 
---
"There are only 10 types of people in the world: Those who understand binary, and those who don't"
 

5
Ortalama: 5 (3 votes)