I linked mysqlserver to tomcat docker and im getting this issue
Finished mysql_install_db
150407 5:23:38 [Note] Plugin 'FEDERATED' is disabled.
150407 5:23:38 InnoDB: The InnoDB memory heap is disabled
150407 5:23:38 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150407 5:23:38 InnoDB: Compressed tables use zlib 1.2.3
150407 5:23:38 InnoDB: Using Linux native AIO
150407 5:23:38 InnoDB: Initializing buffer pool, size = 128.0M
150407 5:23:38 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
150407 5:23:38 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
150407 5:23:38 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
150407 5:23:38 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
150407 5:23:39 InnoDB: Waiting for the background threads to start
150407 5:23:40 InnoDB: 5.5.42 started; log sequence number 0
150407 5:23:40 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
150407 5:23:40 [Note] - '0.0.0.0' resolves to '0.0.0.0';
150407 5:23:40 [Note] Server socket created on IP: '0.0.0.0'.
150407 5:23:40 [Note] Event Scheduler: Loaded 0 events
150407 5:23:40 [Note] mysqld: ready for connections.
Version: '5.5.42' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
150407 5:25:08 [Warning] IP address '172.17.0.21' could not be resolved: Name or service not known
Note: ip address of this container is 172.17.0.19 and i dont understand why it is trying to resolve 172.16.0.21. even tomcat container ip address is 172.17.0.20
Are you seeing any actual errors? I think you can ignore this warning.
Hi @md5,
I think this relates to an issue I was experiencing.
Whenever I would try to connect to the mysql server remotely, I'll get this error:
Host '172.xx.xx.xx' is not allowed to connect to this MySQL server
I had to revert to image tag "5.6.17" from "5.6.25" to have things working as before. I was lazy and was using "latest" until things stopped working.
I believe the reason is because of changes to the start up script and the way users are created and granted access:
https://github.com/docker-library/official-images/commit/857117a721997e50b41dd87e61f795045a610d04
https://github.com/docker-library/mysql/commit/f1b05acff9bcef295b63d39963cfcbf2b8399b08
https://github.com/docker-library/mysql/commit/b5ca4c2e065bd75e246acffd817ec9b5f8bb0c1f#diff-ce9d1cb24c18ab076ee178d2d9325deb
Sorry for the vague info as I'm not too familiar with the way the startup script works.
Thanks for the image!
@md5 Actually I have the same issue now but it's no warning but rather an error my application gets from the mysql server.
What's the best way to debug this?
EDIT: Okay, I just found out that setting the env variables somehow didn't setup the database & user for me. I created them by hand and now everything runs fine. Not what I expected but at least working.
Could you paste the run command / compose config you use to start the image?
@alexanderadam Alternately, did you connect it to an existing database? The init script won't do much if the database is already there.
Hm, I could imagine that the container was first started with different env variables and that it could create something on the volume.
But which is the part that should skip everything in case it's an existing database?
For me it looks like it just needs user and password set to have the user created.
My docker compose config is and was:
mysql:
image: mysql:5.7
ports:
- "3306:3306"
volumes:
- /local/path/to/data:/var/lib/mysql
env_file: db.env
And these env variables:
MYSQL_DATABASE=application_development
MYSQL_ALLOW_EMPTY_PASSWORD=yes
MYSQL_ROOT_PASSWORD=
MYSQL_USER=someuser
MYSQL_PASSWORD=somepassword
TERM=xterm
Perhaps I will use it later on again with a fresh db-volume.
https://github.com/docker-library/mysql/blob/master/5.7/docker-entrypoint.sh#L13 checks if a database ($DATADIR/mysql) already exists.
If so, it skips down to line 108
Closing old issue, especially since this appears to be solved.
In the future, these sorts of questions/requests would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. Thanks!