mysql 관련 문의 입니다.

price의 이미지

root 패스워드를 잃어버려 계정들 db를 설정 못하고 있습니다.

root 패스워드 잃어버렸을때 새로 하는 방법을 여기서 찾아서 했지만

잘 되지가 않아 글을 올립니다.

========================================

root 패스 를 위해 일단 데몬을 죽이고 하는데 잘 되지가 않더라구요...

다음 아래와 같은 과정을 거치는 과정중 되지가 않는 부분을 표기 합니다.

===============================================

[인용]

1. 실행중인 msyql 종료

[root@kebia_1 bin]# ps -ef | grep mysqld

root 9567 1 0 Mar16 ? 00:00:00 sh ./safe_mysqld

root 9576 9567 0 Mar16 ? 00:00:00 /usr/local/mysql/libexec/mysqld

root 9578 9576 0 Mar16 ? 00:00:00 /usr/local/mysql/libexec/mysqld

root 9579 9578 0 Mar16 ? 00:00:00 /usr/local/mysql/libexec/mysqld

[root@kebia_1 bin]#

[root@kebia_1 bin]# killall mysqld

[root@kebia_1 bin]#

============= 여기까지는 잘 진행 되었습니다. 그런데 문제는 아래에서 부터...

2. grant-table 미사용모드로 mysql시작

[root@kebia_1 bin]# ./safe_mysqld --skip-grant-tables&

[1] 12084

================ 여기까지도 잘 됨

[root@kebia_1 bin]# Starting mysqld daemon with databases from /usr/local/mysql/data

============== 윗 부분부터 위에 줄 처럼 치면 bash: Starting : command not 어쩌구 하고 나와요........... 그래서 밑에 줄로 이동 할 수가 없네요.... 고수님들 가르침 바랍니다.

[root@kebia_1 bin]#

[root@kebia_1 bin]# ./mysql -u root mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1 to server version: 3.22.24

Type 'help' for help.

mysql>

3. update문으로 root사용자 패스워드 변경

mysql> update user set password=password('12345') where user = 'root';

Query OK, 3 rows affected (0.00 sec)

Rows matched: 3 Changed: 3 Warnings: 0

mysql> flush privileges;

Query OK, 0 rows affected (0.01 sec)

mysql> exit

Bye

4. 실행중인 mysql 다시 종료

[root@kebia_1 bin]# ps -ef | grep mysqld

root 12084 11558 0 20:10 pts/2 00:00:00 sh ./safe_mysqld --skip-grant-ta

root 12090 12084 0 20:10 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

root 12092 12090 0 20:10 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

root 12093 12092 0 20:10 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

[root@kebia_1 bin]#

[root@kebia_1 bin]# killall mysqld

mysqld daemon ended

[1]+ Done ./safe_mysqld --skip-grant-tables

[root@kebia_1 bin]#

5. 일반모드로 Mysql 재시작

[root@kebia_1 bin]# ./safe_mysqld&

[1] 12102

[root@kebia_1 bin]# Starting mysqld daemon with databases from /usr/local/mysql/data

[root@kebia_1 bin]#

[root@kebia_1 bin]# ps -ef | grep mysql

root 12102 11558 0 20:13 pts/2 00:00:00 sh ./safe_mysqld

root 12108 12102 0 20:13 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

root 12110 12108 0 20:13 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

root 12111 12110 0 20:13 pts/2 00:00:00 /usr/local/mysql/libexec/mysqld

[root@kebia_1 bin]#

rubbe의 이미지

오늘 여러 문제에 부딪히네요. price 님 흑흑..

전반적인 방향은 맞은 것 같구요.. Error message 좀 알려주세요..

혹시나 해서요..첨부터 이렇게 해보세요..

>mysqladmin shutdown
>safe_mysqld -Sg &

이후는 root passwd를 update하는 것은 동일합니다.

위같이 해서 error 생기면 에러메시지 알려주세요.

bear의 이미지

./mysqladmin -u root -p reload

를 해보시면 좋을것 같은데요

price의 이미지

rubbe , bear 님 답변에 감사합니다.

어떨결에 리눅스 서버를 담당하게 되어서 여간 힘든게 아니네요..ㅜㅜ

그래도 여러분들과 같이 탐구해 나간다는게 아주 아주 흥미롭고 고맙네요..

mysql 문제는 해결했습니다... 여러분들 덕분에.. ^^*

좋은 꿈 꾸시고 새로운 낼을 맞이 합시다.. ^^

[ShadowMind_Angels]
배움의 길은 멀고도 험하군요..............
진정한 배움의 길이란 ★━────