Skip to content

Instantly share code, notes, and snippets.

@gschmutz
Created January 29, 2019 19:01
Show Gist options
  • Save gschmutz/3443a66a4654b2493d11db23c45a7ce8 to your computer and use it in GitHub Desktop.
Save gschmutz/3443a66a4654b2493d11db23c45a7ce8 to your computer and use it in GitHub Desktop.
MySQL with an init script
mysql:
image: mysql:5.7
ports:
- 3306:3306
volumes:
# - ./volume/mysql:/var/lib/mysql:rw
- ./scripts/mysql/demo.sql:/docker-entrypoint-initdb.d/demo.sql:ro
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "sample"
MYSQL_USER: "sample"
MYSQL_PASSWORD: "sample"
restart: always
@haiyunhzhang
Copy link

May I ask if there is a way to change the default wait_timeout? My system hits "hibernate.exception.JDBCConnectionException: Unable to acquire JDBC Connection" every 8 hours or so. Somebody says its due to mysql connection idle timer kicking off. Before I found a solution on JDBC side, I need to set the idle timer longer now. Thanks in advance.

@haiyunhzhang
Copy link

My issue could also be caused by the connection pool size. Could you also let me know how to set the pool size through the docker compose? Thanks, Harry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment