반응형

Warning: Using a password on the command line interface can be insecure.

출처 : http://xinet.kr/tc/341


확인 필 : http://myblog.opendocs.co.kr/archives/1591


이렇게 해도 난 뜨는것 같은데...ㅠㅠ

다시 해보기로....



Using a password on the command line interface can be insecure

 mysql 5.6 버전으로 올라가면서 패스우드 정보를 쉘 상태에서 입력하게 되면 위와 같이 에러 메세지가 발생된다 
(실제 에러 메세지가 아닌 경고 메세지이다 )

그럼 이 메세지를 나오지 않게 구성하려면 어떻게 해야 하나?

mysql 5.6 버전에 새로 생긴 mysql_config_editor 툴을 이용하여 로그인 파일을 저장해 놓고 해당 파일을 옵션으로 지정하여 사용

1. 파일 생성하기

[root@localhost ~]# /usr/local/mysql/bin/mysql_config_editor set --login-path=xinet --host=localhost --user=xinet --password
Enter password: (암호입력)

2. 암호화 파일 확인
 암호화 파일은 /root 폴더에 존재한다. 파일 이름은 .mylogin.cnf

이 파일은 암호화 되어 있어서 그냥은 볼수 없다 

그러면 등록된 user가 어느 유저인지 확인하는 명령어가 따로 있다

[root@localhost ~]# /usr/local/mysql/bin/mysql_config_editor print --all
[xinet]
user = xinet
password = *****
host = localhost


3. 접속하기

[root@localhost ~]# /usr/local/mysql/bin/mysql --login-path=/xinet -e "\s"
--------------
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.6.22, for Linux (x86_64) using  EditLine wrapper
Connection id:          1004
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         5.6.22-log Source distribution
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    utf8
Db     characterset:    utf8
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:            /tmp/mysql.sock
Uptime:                 1 hour 38 min 28 sec
Threads: 125  Questions: 2906400  Slow queries: 0  Opens: 1532  Flush tables: 1  Open tables: 112  Queries per second avg: 491.943


이렇게 확인할수 있다 

4. 로그인 정보 특정 유저 삭제하기

[root@localhost ~]# /usr/local/mysql/bin/mysql_config_editor remove --login-path=xinet


이제 응용해서 만들어보면 되겠다. 


반응형

+ Recent posts