I\'m working to containerize a Django 1.5.x application that connects to a MySQL DB on a separate server via ODBC:
[mysql_default]
database = DB_NAME
driver
I solved this by using the docker host address instead of '127.0.0.1' for queries from within the container:
echo "show databases" | mysql -u DB_USER -pDB_USER_PWD -h 10.0.2.2 --port=3306
Because Docker host ip can vary, this post describes steps to get the right address:
How to get the IP address of the docker host from inside a docker container