메뉴 건너뛰기

조회 수 5252 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
## MySQL root 패스워드 분실시

■ Windows 플랫폼

일단 실행되고 있는 MySQL 데몬을 종료 하여야 합니다.

작업 관리자(Ctrl+Shift+Esc) 또는 Ctrl+Alt+Del 을 실행시켜서
mysqld.exe 또는 mysqld-nt.exe 를 찾아서 프로세스 종료 해주신 다음 아래의 방법대로 작업
하시기 바랍니다.

MS-DOS 창을 열어서

Windows 98 :: 시작 -> 실행 -> command
Windows NT :: 시작 -> 실행 -> cmd

MySQL 이 설치된 디렉토리로 이동하신다음


mysqld.exe --skip-grant


다음과 같이 승인 절차를 거치지 않도록 MySQL 데몬을 실행합니다.

또 다른 MS-DOS 창을 열어서 MySQL 이 설치된 디렉토리에서 아래와 같이 실행 합니다.


mysql.exe

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.14-max-debug

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

mysql> use mysql;
Database changed
mysql> UPDATE user SET password=PASSWORD('변경할패스워드') where user='root';
Query OK, 0 rows affected (0.14 sec)
Rows matched: 1 Changed: 0 Warnings: 0

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

mysql> quit
Bye


이젠 먼저 MySQL 데몬을 실행한 도스창을 닫으시고
정상적으로 MySQL 데몬을 실행하시면 변경할패스워드 로 MySQL root 패스워드가 변경되
었습니다.

■ UNIX 플랫폼

MySQL 이 실행되고 있다면


[root@ns /root]# mysql.server stop

또는

[root@ns /root]# killall mysqld

위와 같은 방법으로 MySQL 데몬을 종료 합니다.

이제 승인 절차를 거치지 않도록 MySQL 데몬을 실행합니다.


[root@ns /root]# safe_mysqld --skip-grant &


이제 MySQL root 패스워드를 변경합니다.


[root@ns /root]# mysql

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2918080 to server version: 4.0.16

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

mysql> use mysql;
Database changed
mysql> UPDATE user SET password=PASSWORD('변경할패스워드') where user='root';
Query OK, 0 rows affected (0.14 sec)
Rows matched: 1 Changed: 0 Warnings: 0

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

mysql> quit
Bye


이제 MySQL 데몬을


[root@ns /root]# killall safe_mysqld


위와 같이 종료 하시고 다시 실행시켜 주시면 변경된 패스워드로 동작 합니다


  1. [MySQL] 백업 및 복구

    Date2017.04.12 Views5392
    Read More
  2. MySQL 손상된 테이블 복구

    Date2017.04.12 Views5330
    Read More
  3. MySQL 에서 랜덤(random)으로 레코드 읽어오기

    Date2017.04.12 Views5727
    Read More
  4. MySQL root 패스워드 분실시

    Date2017.04.12 Views5252
    Read More
  5. MySQL 쿼리 결과 값 세로로 보기

    Date2017.04.12 Views6053
    Read More
  6. 테이블 타입(Heap, MyIsam, InnoDB...) 변경하기

    Date2017.04.12 Views5272
    Read More
  7. 백업시 캐릭터셋(charset) 지정하기

    Date2017.04.12 Views5071
    Read More
  8. 세자리 마다 콤마 찍기

    Date2017.04.12 Views5879
    Read More
  9. flush privileges 명령어

    Date2017.04.12 Views5303
    Read More
  10. MySQL JOIN 걸어서 UPDATE 하기

    Date2017.04.12 Views5352
    Read More
  11. mysql(union,join)

    Date2017.11.16 Views3837
    Read More
  12. 서브쿼리

    Date2017.11.16 Views3444
    Read More
  13. mysql(exists, not exists)

    Date2017.11.16 Views4090
    Read More
  14. 다른 테이블 데이터를 원하는 테이블에 업데이트 시키기

    Date2017.11.16 Views5076
    Read More
  15. 특정 COLUMN을 제외하고 SELECT/INSERT하는 방법

    Date2017.11.16 Views8865
    Read More
  16. Union 사용법. 여러 테이블의 같은 값을 한번 쿼리로 추출하기

    Date2017.11.21 Views3918
    Read More
  17. 두 테이블을 비교하여 한쪽테이블에는 있지만 다른 테이블에는 없는 값을 뽑아내보자!

    Date2017.11.21 Views5387
    Read More
  18. Mysql Join 해부(Left, Right, Outer, Inner Join)

    Date2017.11.28 Views5340
    Read More
  19. MySQL Shard 데이터 재분배

    Date2017.11.28 Views4950
    Read More
  20. MySQL 파티션 개요

    Date2017.12.22 Views4150
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 Next
/ 7

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved