I created own docker image, but it seems like cannot start mysql service. logs are below. my.cnf is very simple.
Trying to use /usr/bin/mysqld_safe to start up. It might be very simple mistake, but any suggestion will be appreciate it.
.
my.cnf:
bind-address=0.0.0.0
–skip_name_resolve
–server-id
–log-bin
explicit_defults_for_timestamp=1
.
LOG:.
2016-10-02T03:25:49.513668Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-10-02T03:25:50.080962Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-10-02T03:25:50.490418Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: ead38701-884f-11e6-a59d-0242ac110004.
2016-10-02T03:25:50.530119Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed’ cannot be opened.
2016-10-02T03:25:50.530467Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2016-10-02T15:01:44.333939Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-10-02T15:01:45.559382Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-10-02T15:01:45.667597Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.15-0ubuntu0.16.04.1) starting as process 509 …
2016-10-02T15:01:46.241043Z 0 [Note] InnoDB: PUNCH HOLE support available
2016-10-02T15:01:46.241106Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-10-02T15:01:46.241153Z 0 [Note] InnoDB: Uses event mutexes
2016-10-02T15:01:46.241173Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2016-10-02T15:01:46.241192Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-10-02T15:01:46.241208Z 0 [Note] InnoDB: Using Linux native AIO
2016-10-02T15:01:46.283005Z 0 [Note] InnoDB: Number of pools: 1
2016-10-02T15:01:46.301614Z 0 [Note] InnoDB: Using CPU crc32 instructions
2016-10-02T15:01:46.336793Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2016-10-02T15:01:46.378515Z 0 [Note] InnoDB: Completed initialization of buffer pool
2016-10-02T15:01:46.387524Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2016-10-02T15:01:46.408889Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2016-10-02T15:01:46.517756Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2016-10-02T15:01:46.517938Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2016-10-02T15:01:47.168146Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2016-10-02T15:01:47.171086Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2016-10-02T15:01:47.171145Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2016-10-02T15:01:47.172395Z 0 [Note] InnoDB: Waiting for purge to start
2016-10-02T15:01:47.222610Z 0 [Note] InnoDB: 5.7.15 started; log sequence number 2529638
2016-10-02T15:01:47.224062Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
2016-10-02T15:01:47.224247Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-10-02T15:01:47.234623Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161002 15:01:47
2016-10-02T15:01:47.345070Z 0 [ERROR] unknown variable 'explicit_defults_for_timestamp=0’
2016-10-02T15:01:47.345167Z 0 [ERROR] Aborting
but now SSL issue I think.
I am using noninteractive installation. I haven’t specified SSL, but this warning is required to resolve correct?
mysql is starting up in container, but container is not starting. keep crashing right after I started. docker logs can tell much. any other log I can look?
azureuser@MSLNXUB001:~/mysql$ docker logs thirsty_noether
=> Waiting for confirmation of MySQL service startup, trying 0/60 …
=> Waiting for confirmation of MySQL service startup, trying 1/60 …
=> Waiting for confirmation of MySQL service startup, trying 2/60 …
=> Waiting for confirmation of MySQL service startup, trying 3/60 …
2016-10-02T21:56:14.592593Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
2016-10-02T21:56:14.593891Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2016-10-02T21:56:14.631617Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161002 21:56:14
2016-10-02T21:56:14.852794Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2016-10-02T21:56:14.852853Z 0 [Note] Server hostname (bind-address): ‘127.0.0.1’; port: 3306
2016-10-02T21:56:14.852876Z 0 [Note] - ‘127.0.0.1’ resolves to ‘127.0.0.1’;
2016-10-02T21:56:14.852908Z 0 [Note] Server socket created on IP: ‘127.0.0.1’.
2016-10-02T21:56:14.961703Z 0 [Note] Event Scheduler: Loaded 0 events
2016-10-02T21:56:14.961884Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: ‘5.7.15-0ubuntu0.16.04.1’ socket: ‘/var/run/mysqld/mysqld.sock’ port: 3306 (Ubuntu)
The logs you quoted say the daemon started fine and is listening. Can you paste (a pointer to) your Dockerfile?
One “but”:
If the daemon is listening on 127.0.0.1, nothing outside the container will be able to talk to it. Set the daemon to listen on 0.0.0.0 instead, and if you need to bind to a specific interface on the host, use the appropriate form of docker run -p to do it there.
Issue is for some reason If I run .usr/bin/mysqld_safe & (background process), container die right away.
If I start mysqld_safe without &, it is actually start up. Container is starting, but mysql -uroot -e “CREATE USER ‘${MYSQL_USER}’@’%’ IDENTIFIED BY ‘$PASS’” won’t be executed… like hanging… But I can get in container and can login as root.
So strange thing…
now my shell script has only this.
echo "starting mysql… "
/usr/bin/mysqld_safe &
sleep 10
mysql -uroot -e “CREATE USER ‘${MYSQL_USER}’@’%’ IDENTIFIED BY ‘$PASS’”
Hi I am facing the similar issue. When mysqld_safe is executed container is started but its not executing other statements which are following that statement. For example here mysql -uroot -e “CREATE USER ‘${MYSQL_USER}’@’%’ IDENTIFIED BY ‘$PASS’” won’t be executed….Any help on this would be great.