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