Warning: Using a password on the command line interface can be insecure 다른 방법 해결
DB 2019. 4. 24. 16:08Warning: Using a password on the command line interface can be insecure
에러를 해결하려면
[mariadb/mysqldb]Warning: Using a password on the command line interface can be insecure
shell 에서 mysql db접속시 패스워드를 입력하면 mysql 5.6 부터는 Warning 문구가 발생한다. $ mysql #{database} -u#{username} -p#{password} Warning: Using a password on the command line interface can be..
knight76.tistory.com
그러나, 테스트 환경 (CI/CD) 구축때는 조금 꼭 이렇게 하는게 부담스러울 수 있는데..-p패스워드 처럼 편한게 어디 있나..
그래서 에러 출력만 안나오게 하는 방법이 있다. 2> /dev/null를 이용하는 방법이 좋을 수 있다.
docker-compose exec -T mysql mysql -uroot -p패스워드 -e "set global general_log=on" 2> /dev/null
그러나 확인할 때는 > /dev/null 2>1 를 사용할 수 도 있다.
is_success=$(docker-compose exec -T mysql mysql -uroot -p패스워드 -e "show databases" > /dev/null 2>1 && echo "true")
'DB' 카테고리의 다른 글
[mysql] CHARACTER COLLATE 테이블, 컬럼 속성 변경하기 (0) | 2019.07.12 |
---|---|
[mysql] mysql 5.7에서 Waiting for table metadata lock 재현 및 해결하기 (0) | 2019.06.11 |
[mysql] timestamp 타입 주의사항 (0) | 2019.03.06 |
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 104 (0) | 2019.01.11 |
[oracle] ORA-01843: not a valid month 해결 하기 (0) | 2018.12.03 |