달력

4

« 2024/4 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
2012. 11. 22. 12:36

mysql 패스워드 분실시 대처 방법 I.lib()/I.lib(Mysql)2012. 11. 22. 12:36

.. .. ..

출처 : http://www.superuser.co.kr/home/superuserboard/view.html?id=1192&code=mysql&start=640&position=

설치시 에럭 나타날때
[qtam@localhost qtam]$ mysql -u root mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

1. -h (호스트) 적용
2. mysql killall safe_mysqld --user=mysql --skip-grant-table &
3.

MySQL 을 처음 설치한 후 아무런 변경도 하지 않는 경우에는 root 사용자의 암호가 설정되
어 있지 않습니다. 따라서 MySQL 을 처음 설치한 경우에는 다음과 같은 명령으로 MySQL
서버에 연결을 할 수 있습니다.
[wertyu@inos ~]$ mysql -u root mysql

여기서 주의할 점은 mysql 은 -u 옵션으로 사용자 명을 주지 않는 경우 시스템 계정 사용자
의 이름을 이용한다는 것입니다.
[wertyu@inos ~]$ mysql mysql
ERROR 1045: Access denied for user: 'wertyu@localhost' (Using password: NO)

만약 mysql 을 사용하면서 다음과 같은 에러가 발생한다면 사용자에게 암호가 걸려 있는 것
입니다.
[wertyu@inos ~]$ mysql -uroot mysql
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)



- mysql root 비밀번호 잊어 먹었을 때
[root@localhost local]# killall mysqld

//권한없이 접속가능하도록하는옵션입니다.
[root@localhost local]# /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &

//mysql로 접속합니다.
[root@localhost local]# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2 to server version: 4.0.20-log

//비밀번호를 변경합니다.
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, 2 rows affected (0.02 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> exit
Bye

//mysql을 중지시키고 다시 스타트합니다.
[root@localhost local]# killall mysqld
[root@localhost local]# /usr/local/mysql/bin/mysqld_safe &

 

.
:
Posted by .07274.