Enable MySQL docker container log

Paul Tang
1 min readApr 30, 2020

--

Docker is convenient for debugging and development, and MySQL is a great open source RDBMS system. So sometimes if we want to get the log from MySQL container, here’s a small tip.

mysql> set global general_log=1;

Enable general_log in mysql

show variables like 'general_log_file';

And show the absolute path of general_log_file in Docker container.

docker exec -it CONTAINER_ID tail -f LOG_PATH

Ref: https://blog.csdn.net/qingsong3333/article/details/78025039

--

--

Paul Tang
Paul Tang

Written by Paul Tang

初來乍到,剛到東京的菜鳥後端工程師,希望有一天能成為獨當一面的Full Stack Hacker

No responses yet