Warning: Using a password on the command line interface can be insecure 다른 방법 해결
Warning: 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")