더북(TheBook)

Tip 바로 로그인하지 않고 자꾸 패스워드를 입력하라고 하네요!


MySQL이나 MariaDB에 접속할 때는 mysql 명령어를 이용합니다. 이때 자꾸 패스워드를 입력하라는 메시지가 표시되면서 패스워드를 입력해야만 실행 프롬프트에 접속할 수 있는 문제가 발생합니다.

root@controller:~# mysql -u root -p
Enter password: 패스워드 입력 Enter
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 41
Server version: 10.0.24-MariaDB-7 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>


이 문제는 MySQL을 실행할 때 -p 옵션 뒤에 빈칸 없이 바로 패스워드를 입력하면 해결할 수 있습니다. 그러면 다음과 같이 패스워드를 입력하라는 메시지 없이 바로 실행 프롬프트에 접속합니다.

root@controller:~# mysql -u root -popenstack
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 40
Server version: 10.0.24-MariaDB-7 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.