강좌
클라우드/리눅스에 관한 강좌입니다.
데이터베이스 분류

MYSQL 실행시 grant table권한없이 실행하기

작성자 정보

  • 구돌 작성
  • 작성일

컨텐츠 정보

본문

MYSQL 실행시 grant table권한없이 실행하기

 

MYSQL을 실행할 때에 table grant권한을 생략하고 실행을 할 수 있습니다.   

 

 

  , 패스워드가 설정되어 있는 모든 사용자들이 패스워드없이 MYSQL에 바로 접속을 할 수 있기 때문에 주로 MYSQL root계정의 비밀번호를 잊어버렸을 경우에 table grant권한을 생략하여 MYSQL을 실행시킨 다음 MYSQL root사용자의 비밀번호를 변경하는 용도로 많이 사용됩니다.   

 

 

 

 

또한 table grant권한을 생략하여 MYSQL을 실행하면 MYSQL root사용자뿐아니라 일반사용자들도 패스워드없이 MYSQL로 바로 접속을 할 수 있습니다.   

 

 

 

 

, table grant권한없이 시작하려면 mysqld_safe명령어로 MYSQL시작시에 다음과 같이 --skip-grant-table옵션을 사용하시면 됩니다.   

 

 

 

 

[root@file bin]# ./mysqld_safe --skip-grant-table &

[1] 3888

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

 

[root@file bin]#

 

위와 같이 mysqld_safe명령어로 MYSQL을 시작할 때에 --skip-grant-table옵션을 사용하여 실행하면 MYSQL접속시에 패스워드 없이 바로 접속할 수 있습니다.   

 

 

 

 

다음은 위와 같이 실행된 후에 ps명령어로 MYSQL 프로세스를 확인한 것입니다.   

 

 

 보시는 바와 같이 --skip-grant-table이라는 옵션이 적용되어 실행되었다는 것을 확인할 수 있습니다.   

 

 

 

 

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

root   4262 4113  0 22:25 pts/0  00:00:00 /bin/sh ./mysqld_safe --skip-grant-table

mysql  4278  4262  0 22:25 pts/0    00:00:00 [mysqld]

root   4293  4113  0 22:30 pts/0    00:00:00 grep mysqld

[root@file bin]#

 

 

이렇게 실행된 후에는 다음과 같이 MYSQL에 접속할 때에 패스워드 없이 바로 접속할 수 있습니다.   

 

 

  다음은 MYSQL root사용자가 패스워드없이 바로 접속한 예입니다.   

 

 

 

 

[root@file 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: 4.0.14

 

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

 

mysql>

mysql> exit

Bye

[root@file bin]#

 

 

다음은 MYSQL의 일반사용자인 tempuser라는 사용자가 패스워드없이 바로 접속한 예입니다.   

 

 

 

 

[root@file bin]# ./mysql -u tempuser temp_db2

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: 4.0.14

 

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

 

mysql>

mysql> exit

Bye

[root@file bin]#

 

 

 

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,037 명
  • 현재 강좌수 :  35,810 개
  • 현재 접속자 :  114 명