docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.46k stars 2.2k forks source link

mysql immediately stops after running #3

Closed quinn closed 6 years ago

quinn commented 10 years ago

I run this command:

docker run -e MYSQL_ROOT_PASSWORD=root --rm -i -t mysql

And I get this output:

Installing MySQL system tables...2014-07-25 16:13:10 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-25 16:13:10 15 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-25 16:13:10 15 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-25 16:13:10 15 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-25 16:13:10 15 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-25 16:13:10 15 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-25 16:13:10 15 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-25 16:13:10 15 [Note] InnoDB: Completed initialization of buffer pool
2014-07-25 16:13:10 15 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-07-25 16:13:10 15 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-07-25 16:13:10 15 [Note] InnoDB: Database physically writes the file full: wait...
2014-07-25 16:13:10 15 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-07-25 16:13:11 15 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-07-25 16:13:11 15 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-07-25 16:13:11 15 [Warning] InnoDB: New log files created, LSN=45781
2014-07-25 16:13:11 15 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-07-25 16:13:11 15 [Note] InnoDB: Doublewrite buffer created
2014-07-25 16:13:11 15 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-25 16:13:11 15 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-07-25 16:13:11 15 [Note] InnoDB: Foreign key constraint system tables created
2014-07-25 16:13:11 15 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-07-25 16:13:11 15 [Note] InnoDB: Tablespace and datafile system tables created.
2014-07-25 16:13:11 15 [Note] InnoDB: Waiting for purge to start
2014-07-25 16:13:11 15 [Note] InnoDB: 5.6.17 started; log sequence number 0
2014-07-25 16:13:11 15 [Note] Binlog end
2014-07-25 16:13:11 15 [Note] InnoDB: FTS optimize thread exiting.
2014-07-25 16:13:11 15 [Note] InnoDB: Starting shutdown...
2014-07-25 16:13:13 15 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2014-07-25 16:13:13 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-25 16:13:13 39 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-25 16:13:13 39 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-25 16:13:13 39 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-25 16:13:13 39 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-25 16:13:13 39 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-25 16:13:13 39 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-25 16:13:13 39 [Note] InnoDB: Completed initialization of buffer pool
2014-07-25 16:13:13 39 [Note] InnoDB: Highest supported file format is Barracuda.
2014-07-25 16:13:13 39 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-25 16:13:13 39 [Note] InnoDB: Waiting for purge to start
2014-07-25 16:13:13 39 [Note] InnoDB: 5.6.17 started; log sequence number 1625977
2014-07-25 16:13:13 39 [Note] Binlog end
2014-07-25 16:13:13 39 [Note] InnoDB: FTS optimize thread exiting.
2014-07-25 16:13:13 39 [Note] InnoDB: Starting shutdown...
2014-07-25 16:13:14 39 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h 3a7b83432209 password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

And then the docker run is finished. Any thoughts? I'v tried running with bash interactively and running with different commands (mysqld_safe, mysql.server) and nothing seems to work. What am I missing here?

tianon commented 10 years ago

You could also run this (or something similar) to get more debugging output that would be useful for us to figure out what's going on that's killing MySQL:

$ docker run -it --rm -e MYSQL_ROOT_PASSWORD=something-silly-and-not-nearly-secure-enough mysql bash
root@36d99629e4ed:/usr/local/mysql# bash -x /entrypoint.sh mysqld --datadir=/var/lib/mysql --user=mysql
+ set -e
++ ls -A /var/lib/mysql
+ '[' -z '' -a mysqld = mysqld ']'
+ '[' -z something-silly-and-not-nearly-secure-enough ']'
+ mysql_install_db --datadir=/var/lib/mysql
Installing MySQL system tables...2014-07-28 22:47:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-28 22:47:37 20 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-28 22:47:37 20 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-28 22:47:37 20 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-28 22:47:37 20 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-28 22:47:37 20 [Note] InnoDB: Using CPU crc32 instructions
2014-07-28 22:47:37 20 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-28 22:47:37 20 [Note] InnoDB: Completed initialization of buffer pool
2014-07-28 22:47:37 20 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-07-28 22:47:37 20 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-07-28 22:47:37 20 [Note] InnoDB: Database physically writes the file full: wait...
2014-07-28 22:47:37 20 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-07-28 22:47:38 20 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-07-28 22:47:43 20 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-07-28 22:47:43 20 [Warning] InnoDB: New log files created, LSN=45781
2014-07-28 22:47:43 20 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-07-28 22:47:43 20 [Note] InnoDB: Doublewrite buffer created
2014-07-28 22:47:43 20 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-28 22:47:44 20 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-07-28 22:47:44 20 [Note] InnoDB: Foreign key constraint system tables created
2014-07-28 22:47:44 20 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-07-28 22:47:44 20 [Note] InnoDB: Tablespace and datafile system tables created.
2014-07-28 22:47:44 20 [Note] InnoDB: Waiting for purge to start
2014-07-28 22:47:44 20 [Note] InnoDB: 5.6.17 started; log sequence number 0
2014-07-28 22:47:51 20 [Note] Binlog end
2014-07-28 22:47:51 20 [Note] InnoDB: FTS optimize thread exiting.
2014-07-28 22:47:51 20 [Note] InnoDB: Starting shutdown...
2014-07-28 22:47:52 20 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2014-07-28 22:47:52 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-28 22:47:52 44 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-28 22:47:52 44 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-28 22:47:52 44 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-28 22:47:52 44 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-28 22:47:52 44 [Note] InnoDB: Using CPU crc32 instructions
2014-07-28 22:47:52 44 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-28 22:47:52 44 [Note] InnoDB: Completed initialization of buffer pool
2014-07-28 22:47:52 44 [Note] InnoDB: Highest supported file format is Barracuda.
2014-07-28 22:47:52 44 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-28 22:47:52 44 [Note] InnoDB: Waiting for purge to start
2014-07-28 22:47:52 44 [Note] InnoDB: 5.6.17 started; log sequence number 1625977
2014-07-28 22:47:53 44 [Note] Binlog end
2014-07-28 22:47:53 44 [Note] InnoDB: FTS optimize thread exiting.
2014-07-28 22:47:53 44 [Note] InnoDB: Starting shutdown...
2014-07-28 22:47:54 44 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h 36d99629e4ed password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

+ cat
+ chown -R mysql:mysql /var/lib/mysql
+ exec mysqld --datadir=/var/lib/mysql --user=mysql --init-file=/tmp/mysql-first-time.sql
2014-07-28 22:47:54 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-28 22:47:54 11 [Note] Plugin 'FEDERATED' is disabled.
2014-07-28 22:47:54 11 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-28 22:47:54 11 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-28 22:47:54 11 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-28 22:47:54 11 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-28 22:47:54 11 [Note] InnoDB: Using CPU crc32 instructions
2014-07-28 22:47:54 11 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-28 22:47:54 11 [Note] InnoDB: Completed initialization of buffer pool
2014-07-28 22:47:54 11 [Note] InnoDB: Highest supported file format is Barracuda.
2014-07-28 22:47:54 11 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-28 22:47:55 11 [Note] InnoDB: Waiting for purge to start
2014-07-28 22:47:55 11 [Note] InnoDB: 5.6.17 started; log sequence number 1625987
2014-07-28 22:47:55 11 [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: 36b5e90f-16a9-11e4-9bf6-ca9e6c5f5a1f.
2014-07-28 22:47:55 11 [Note] Server hostname (bind-address): '*'; port: 3306
2014-07-28 22:47:55 11 [Note] IPv6 is available.
2014-07-28 22:47:55 11 [Note]   - '::' resolves to '::';
2014-07-28 22:47:55 11 [Note] Server socket created on IP: '::'.
2014-07-28 22:47:55 11 [Note] Event Scheduler: Loaded 0 events
2014-07-28 22:47:55 11 [Note] Execution of init_file '/tmp/mysql-first-time.sql' started.
2014-07-28 22:47:55 11 [Note] Execution of init_file '/tmp/mysql-first-time.sql' ended.
2014-07-28 22:47:55 11 [Note] mysqld: ready for connections.
Version: '5.6.17'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

<hangs, listening for connections>
yosifkit commented 10 years ago

The image id I have is 36e732ca2610. What image id do you have? Running your same command, it continues past the point where yours stops.

Here is the output past that point:

2014-07-28 22:39:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-07-28 22:39:32 1 [Note] Plugin 'FEDERATED' is disabled.
2014-07-28 22:39:32 1 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-07-28 22:39:32 1 [Note] InnoDB: The InnoDB memory heap is disabled
2014-07-28 22:39:32 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-07-28 22:39:32 1 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-07-28 22:39:32 1 [Note] InnoDB: Not using CPU crc32 instructions
2014-07-28 22:39:32 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-07-28 22:39:32 1 [Note] InnoDB: Completed initialization of buffer pool
2014-07-28 22:39:32 1 [Note] InnoDB: Highest supported file format is Barracuda.
2014-07-28 22:39:32 1 [Note] InnoDB: 128 rollback segment(s) are active.
2014-07-28 22:39:32 1 [Note] InnoDB: Waiting for purge to start
2014-07-28 22:39:32 1 [Note] InnoDB: 5.6.17 started; log sequence number 1625987
2014-07-28 22:39:32 1 [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: 0b52ab28-16a8-11e4-9bee-76abfbb048e3.
2014-07-28 22:39:32 1 [Note] Server hostname (bind-address): '*'; port: 3306
2014-07-28 22:39:32 1 [Note] IPv6 is available.
2014-07-28 22:39:32 1 [Note]   - '::' resolves to '::';
2014-07-28 22:39:32 1 [Note] Server socket created on IP: '::'.
2014-07-28 22:39:32 1 [Note] Event Scheduler: Loaded 0 events
2014-07-28 22:39:32 1 [Note] Execution of init_file '/tmp/mysql-first-time.sql' started.
2014-07-28 22:39:32 1 [Note] Execution of init_file '/tmp/mysql-first-time.sql' ended.
2014-07-28 22:39:32 1 [Note] mysqld: ready for connections.
Version: '5.6.17'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
justinalgo commented 10 years ago

I encountered this same issue today. Setup:

Windows 7 64 bit Vagrant 1.6.3 running "ubuntu/trusty64" (Ubuntu 14.04 LTS) box with docker

I was able to get it all working by running the following vagrant box: hashicorp/precise64 (Ubuntu 12.04 LTS). No other changes.

Hopefully this might help during troubleshooting.

EDIT: this was using the same image yosifkit mentioned, 36e732ca2610.

voanhduy1512 commented 10 years ago

I encountered the same issue in image a950533b3019

root@8f5cb135dd63:/usr/local/mysql# bash -x /entrypoint.sh mysqld --datadir=/var/lib/mysql --user=mysql
+ set -e
++ ls -A /var/lib/mysql
+ '[' -z '' -a mysqld = mysqld ']'
+ '[' -z root ']'
+ mysql_install_db --user=mysql --datadir=/var/lib/mysql
Installing MySQL system tables...2014-08-31 15:09:06 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-31 15:09:06 16 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-31 15:09:06 16 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-31 15:09:06 16 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-31 15:09:06 16 [Note] InnoDB: Memory barrier is not used
2014-08-31 15:09:06 16 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-31 15:09:06 16 [Note] InnoDB: Using Linux native AIO
2014-08-31 15:09:06 16 [Note] InnoDB: Using CPU crc32 instructions
2014-08-31 15:09:06 16 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-08-31 15:09:06 16 [Note] InnoDB: Completed initialization of buffer pool
2014-08-31 15:09:06 16 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-08-31 15:09:06 16 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-08-31 15:09:06 16 [Note] InnoDB: Database physically writes the file full: wait...
2014-08-31 15:09:06 16 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-08-31 15:09:07 16 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-08-31 15:09:07 16 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-08-31 15:09:07 16 [Warning] InnoDB: New log files created, LSN=45781
2014-08-31 15:09:07 16 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-08-31 15:09:07 16 [Note] InnoDB: Doublewrite buffer created
2014-08-31 15:09:07 16 [Note] InnoDB: 128 rollback segment(s) are active.
2014-08-31 15:09:07 16 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-08-31 15:09:07 16 [Note] InnoDB: Foreign key constraint system tables created
2014-08-31 15:09:07 16 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-08-31 15:09:07 16 [Note] InnoDB: Tablespace and datafile system tables created.
2014-08-31 15:09:07 16 [Note] InnoDB: Waiting for purge to start
2014-08-31 15:09:07 16 [Note] InnoDB: 5.6.20 started; log sequence number 0
2014-08-31 15:09:07 16 [Note] Binlog end
2014-08-31 15:09:07 16 [Note] InnoDB: FTS optimize thread exiting.
2014-08-31 15:09:07 16 [Note] InnoDB: Starting shutdown...
2014-08-31 15:09:09 16 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2014-08-31 15:09:09 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-31 15:09:09 39 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-31 15:09:09 39 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-31 15:09:09 39 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-31 15:09:09 39 [Note] InnoDB: Memory barrier is not used
2014-08-31 15:09:09 39 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-31 15:09:09 39 [Note] InnoDB: Using Linux native AIO
2014-08-31 15:09:09 39 [Note] InnoDB: Using CPU crc32 instructions
2014-08-31 15:09:09 39 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-08-31 15:09:09 39 [Note] InnoDB: Completed initialization of buffer pool
2014-08-31 15:09:09 39 [Note] InnoDB: Highest supported file format is Barracuda.
2014-08-31 15:09:09 39 [Note] InnoDB: 128 rollback segment(s) are active.
2014-08-31 15:09:09 39 [Note] InnoDB: Waiting for purge to start
2014-08-31 15:09:09 39 [Note] InnoDB: 5.6.20 started; log sequence number 1625977
2014-08-31 15:09:09 39 [Note] Binlog end
2014-08-31 15:09:09 39 [Note] InnoDB: FTS optimize thread exiting.
2014-08-31 15:09:09 39 [Note] InnoDB: Starting shutdown...
2014-08-31 15:09:11 39 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h 8f5cb135dd63 password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

+ TEMP_FILE=/tmp/mysql-first-time.sql
+ cat
+ '[' '' ']'
+ '[' '' -a '' ']'
+ echo 'FLUSH PRIVILEGES ;'
+ set -- mysqld --datadir=/var/lib/mysql --user=mysql --init-file=/tmp/mysql-first-time.sql
+ chown -R mysql:mysql /var/lib/mysql
+ exec mysqld --datadir=/var/lib/mysql --user=mysql --init-file=/tmp/mysql-first-time.sql
2014-08-31 15:09:12 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-08-31 15:09:13 9 [Warning] Buffered warning: Performance schema disabled (reason: init failed).

2014-08-31 15:09:13 9 [Note] Plugin 'FEDERATED' is disabled.
2014-08-31 15:09:13 9 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-08-31 15:09:13 9 [Note] InnoDB: The InnoDB memory heap is disabled
2014-08-31 15:09:13 9 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-08-31 15:09:13 9 [Note] InnoDB: Memory barrier is not used
2014-08-31 15:09:13 9 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-08-31 15:09:13 9 [Note] InnoDB: Using Linux native AIO
2014-08-31 15:09:13 9 [Note] InnoDB: Using CPU crc32 instructions
2014-08-31 15:09:13 9 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2014-08-31 15:09:13 9 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2014-08-31 15:09:13 9 [ERROR] Plugin 'InnoDB' init function returned error.
2014-08-31 15:09:13 9 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-08-31 15:09:13 9 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-08-31 15:09:13 9 [ERROR] Aborting

2014-08-31 15:09:13 9 [Note] Binlog end
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'partition'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'ARCHIVE'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'BLACKHOLE'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_METRICS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_CMPMEM'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_CMP'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_LOCKS'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'INNODB_TRX'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'CSV'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'MEMORY'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'MRG_MYISAM'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'MyISAM'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'sha256_password'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'mysql_old_password'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'mysql_native_password'
2014-08-31 15:09:13 9 [Note] Shutting down plugin 'binlog'
2014-08-31 15:09:13 9 [Note] mysqld: Shutdown complete
tianon commented 10 years ago

It looks to me like your machine is out of memory:

2014-08-31 15:09:13 9 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2014-08-31 15:09:13 9 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2014-08-31 15:09:13 9 [ERROR] Plugin 'InnoDB' init function returned error.
2014-08-31 15:09:13 9 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2014-08-31 15:09:13 9 [ERROR] Unknown/unsupported storage engine: InnoDB
2014-08-31 15:09:13 9 [ERROR] Aborting
voanhduy1512 commented 10 years ago

I try it again on a 1GB memory machine and it worked. Thank you

thaJeztah commented 10 years ago

I ran into the same problem, running the image on a 1GB DigitalOcean droplet. Creating a swapfile "solved" this issue.

However, running the image used a whopping 460 MB of memory. Switching back to the old OrchardUp image (https://github.com/orchardup/docker-mysql) only used 80MB.

I'll do some further testing, but based in this, it seems that this image is more targeted at "production" situations and not tuned-down for smaller VPS installations. I don't see any customisation wrt memory use in the orchardup image that could explain this (apart from an older ubuntu and mysql version), so I'm not really sure what's causing this.

yosifkit commented 10 years ago

So I looked over the orchard/docker-mysql and saw that the default config that we are using was extremely minimal (one uncommented line), while they are using extra options on top of the my.cnf that comes from apt-get. I copied the my.cnf from a mysql-5.5 install on debian and removed extraneous lines with no improvement on memory footprint:

# The MySQL database server configuration file.
[mysqld]

user        = mysql
datadir     = /var/lib/mysql
skip-external-locking

key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8

query_cache_limit   = 1M
query_cache_size        = 16M

expire_logs_days    = 10
max_binlog_size         = 100M

Any other ideas that could solve such a huge memory footprint?

morgo commented 10 years ago

MySQL 5.6 has changed the defaults to use more memory (and perform better): http://www.tocker.ca/2013/09/10/improving-mysqls-default-configuration.html

To use minimal memory: http://www.tocker.ca/2014/03/10/configuring-mysql-to-use-minimal-memory.html

yajo commented 9 years ago

I ran into the same problem, running the image on a 1GB DigitalOcean droplet. Creating a swapfile "solved" this issue.

Thanks for the workaround, it worked for me too.

thaJeztah commented 9 years ago

@morgo thanks for those links.

In general; do we need to change the settings to reduce the memory footprint?

The problem obviously is that it really depends how the image is going to be used;

Ways to achieve this;

Wdyt?

tianon commented 9 years ago

I'm +1 on this being a documentation problem. Generally, we should defer to upstream as much as possible; if they changed the defaults, then it was likely for a good reason. Even if it wasn't, changing the defaults is their prerogative, IMO, so I'd hesitate to willy-nilly override their defaults unless we've got a solid justification for the general Docker use-case being significantly different from the general non-Docker use-case.

I'd also imagine that the majority of folks looking to seriously put MySQL in production are going to have other configuration tweaks to make too, especially for performance, so for those users to adjust the memory footprint if they so need shouldn't be that big of a deal either.

morgo commented 9 years ago

@tianon I agree. Upstream previously maintained small/medium/large configuration files, but has since deprecated them as they caused trouble. A suggestion for documentation:

This is designed to work with 1GB of RAM or more. It may be configured to use less memory, but is not recommended. For larger installations, consult [guide] to improving configuration.

thaJeztah commented 9 years ago

I'm thinking along the same line. Was giving this some more thought after I wrote my comment; this is how I see it;

All images in the standards library are meant to be used as a base (FROM) image to build your image upon. In most cases the images are not meant to be used as an end-product that's directly "consumable" in your stack, simply because they are not yet configured properly.

In this light; perhaps a generic note stating this should be added to all standard library images? (Unless, of course I'm misinterpreting) wdyt?

For this particular case, some notes and perhaps an example on how to craft / modify and/or add a my.cnf would be good.

morgo commented 9 years ago

You are free to copy my post here: http://www.tocker.ca/2013/09/17/what-to-tune-in-mysql-56-after-installation.html - perhaps there is a way you can incorporate this into documentation?

thaJeztah commented 9 years ago

@morgo are you willing to create a PR for the docs?

As I see it, the README should only contain some basic pointers so that it doesn't become too lengthy, but links to extended documentation in the GitHub repository would be nice. Would be awesome if you could provide that.

(Just speaking for myself here, I'm not a maintainer :smile:)

korjavin commented 9 years ago

My vote for branches: small,medium, huge etc...

For my typical use , like wordpress in 500mb digital ocean its a disaster.

arun-gupta commented 9 years ago

The log is very confusing where it shows "Shutdown completed" twice before an attempt to start. Why that is so?

dmuth commented 9 years ago

+1 for branches such as "small", "medium", and "huge".

This is my first foray into Docker, and needing to create a 1 GB CoreOS instance just to run MySQL and verify connectivity seems like overkill.

thaJeztah commented 9 years ago

@dmuth you should be able to get it running on a smaller droplet by creating a swap file and/or creating a custom config for MySQL

dmuth commented 9 years ago

@thaJeztah Indeed I was able to make it run by messing with the configuration.

That said, I don't think that every single person who tries Docker and runs into problems with MySQL is going to do a Google search on the problem and learn that they need more RAM. This risks alienating people who are new to Docker.

This behavior from MySQL is also a stark contrast from everything else I've experienced with Docker--I worked through all of the examples in the documentation (python's sample app, etc., linking that app to Postgres, etc.), and I could make everything "just work" in a virtual machine with 256 Megs of RAM. I think it would behoove the Docker project to have similar "out of the box" behavior from MySQL as well.

thaJeztah commented 9 years ago

Agreed, or add some documentation on how to use / configure. I don't have the time myself to write, but if you have ideas, feel free to do so. Some useful links in this discussion also.

morgo commented 9 years ago

I don't think it's good if Docker changes its config over the defaults that ship with the official MySQL. RDS does this (albeit with other settings), and it only leads to confusion. Example: http://www.percona.com/blog/2014/07/08/timestamp-columns-amazon-rds-5-6-and-you/

So I would suggest that the better fix is a swap file for VMs of ~512M RAM.

To use 256M RAM, the configuration will need to change. It is possible to do this in the installer script - I have minimal config files here: https://github.com/morgo/mysql-compatibility-config/blob/master/mysql-56/mysql-minimal.cnf https://github.com/morgo/mysql-compatibility-config/blob/master/mysql-57/mysql-minimal.cnf

The only request I would have, is make sure the user knows they are in low-memory mode and some features have been disabled over regular MySQL.

dmuth commented 9 years ago

Ooh, that's a really good point about RDS. Based on that alone, I think it's a better idea to stick with the defaults and swap to be used instead.

It's worth pointing out that CoreOS doesn't seem to come with swap enabled, at least not when I run it under Vagrant. Adding swap is easy enough, but it might be a good idea if CoreOS had swap by default. I'll try reaching out to the CoreOS folks.

clarenced commented 9 years ago

Hi, I have the same problem. When I run the command : docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=mysecretpassword -d mysql, the container exits automatically.

docker logs my-container only displays :

Running mysql_install_db ... Finished mysql_install_db.

I am a beginner at Docker and don't know how to correct this problem?

yosifkit commented 9 years ago

@clarenced, If you are running on a Mac using boot2docker, you will probably need to increase the memory available to the VM: stackoverflow.

sformisano commented 9 years ago

EDIT: this was due to a typo, which was due to sleep deprivation. Please ignore :)

I just figured I'd let people in this thread know that I'm having similar issues with Docker 1.5.0 and the latest mysql image:

1) When I create a container on its own, without volumes, the container seems to work just fine

2) When I create a container with a volume, the container exists right away and the logs show this:

Running mysql_install_db ... 2015-03-08 04:14:28 14 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-03-08 04:14:28 14 [Note] InnoDB: The InnoDB memory heap is disabled 2015-03-08 04:14:28 14 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-03-08 04:14:28 14 [Note] InnoDB: Memory barrier is not used 2015-03-08 04:14:28 14 [Note] InnoDB: Compressed tables use zlib 1.2.7 2015-03-08 04:14:28 14 [Note] InnoDB: Using Linux native AIO 2015-03-08 04:14:28 14 [Note] InnoDB: Not using CPU crc32 instructions 2015-03-08 04:14:28 14 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2015-03-08 04:14:28 14 [Note] InnoDB: Completed initialization of buffer pool 2015-03-08 04:14:28 7fdd997c7720 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. 2015-03-08 04:14:28 7fdd997c7720 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. 2015-03-08 04:14:28 14 [ERROR] InnoDB: Creating or opening ./ibdata1 failed! 2015-03-08 04:14:28 14 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data! 2015-03-08 04:14:28 14 [ERROR] Plugin 'InnoDB' init function returned error. 2015-03-08 04:14:28 14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2015-03-08 04:14:28 14 [ERROR] Unknown/unsupported storage engine: InnoDB 2015-03-08 04:14:28 14 [ERROR] Aborting

2015-03-08 04:14:28 14 [Note] Binlog end 2015-03-08 04:14:28 14 [Note] /usr/sbin/mysqld: Shutdown complete

3) When using docker-compose to create a mysql "db" service linked to my main web container, the mysql container also exits right away, but for what seems to be a different reason:

"error: database is uninitialized and MYSQL_ROOT_PASSWORD not set Did you forget to add -e MYSQL_ROOT_PASSWORD=... ?"

FYI I do set the MYSQL_ROOT_PASSWORD env variable in the docker-compose yaml file.

This is all a bit surprising given that the ochardup/mysql image works 100% fine in all these scenarios.

thaJeztah commented 9 years ago

When I create a container on its own, without volumes, the container seems to work just fine

With "without volume", you mean without a bind-mounted volume? The image itself already defines a volume; https://github.com/docker-library/mysql/blob/master/5.7/Dockerfile#L35

When I create a container with a volume, the container exists right away and the logs show this:

I'm guessing (see above) you're using a bind-mounted volume (ie, -v /host/path:/container/path). This might be the problem here if the permissions on the host aren't correctly set, causing the container to not have permissions to read/write from that location. IIRC, mysql in the orchardup/mysql ran as "root", which may be the difference (not 100% sure)

FYI I do set the MYSQL_ROOT_PASSWORD env variable in the docker-compose yaml file.

Perhaps you are able to check if the MYSQL_ROOT_PASSWORD env was correctly set, by doing docker inspect <container-name>; you should see the environment variable in the output.

sformisano commented 9 years ago

EDIT: this was due to a typo, which was due to sleep deprivation. Please ignore :)

Yes I meant bind-mounted volume, sorry it was very late :) I tried to update permissions of the directory but that didn't fix it.

Also, again I was very tired - I didnt realise that the same exact issue I have with the official mysql image happens with the orchard mysql image as well.

RE ENV variables, they do seem to be set as when I inspect the mysql container this is the ENV object:

    "Env": [
        "MYSQL_ROOT_PASSWORD=test_foo_bar",
        "MYSQL_PASSWORD=Rah7shaeyaiLiTha2ieviek9noshiepayaLu",
        "MYSQL_USER=wp_user",
        "MYSQL_DATABASE=wp_db",
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
        "MYSQL_MAJOR=5.6",
        "MYSQL_VERSION=5.6.23"
    ],

I'm a bit lost on what the issue could be. Anyone?

duhruh commented 9 years ago

:+1:

anyone got a fix for this i'm also experiencing this following the docker-compose with rails example using mysql instead of postgres. That tutorial works great with postgres so i assumed just switching to mysql would be just as simple :worried:

sformisano commented 9 years ago

So, the only problem left is literally bind-mounting a volume. Without the bind-mount, mysql works flawlessly, that root password issue was due to a typo as explained above. So, docker-compose up works great and all, but as soon as I bind-mount the mysql data volume the container exists as soon as it starts.

I'm on OSX.

md5 commented 9 years ago

@sformisano I work around this by creating a /data directory inside my boot2docker VM on the same data disk as /var/lib/boot2docker. My /var/lib/boot2docker/bootlocal.sh looks like this:

#!/bin/sh

set -ue

MOUNTPOINT="$(df /var/lib/boot2docker 2> /dev/null | awk 'NR > 1 { print $NF }')"

if [ -z "$MOUNTPOINT" ]; then
    echo 2>&1 'Unable to determine mount point for /var/lib/boot2docker'
    exit
fi

mkdir -p "$MOUNTPOINT/data"
ln -sf "$MOUNTPOINT/data" /data

That lets me do stuff like -v /data/mysql:/var/lib/mysql and have it work without too much extra hassle, but it doesn't allow me to access that data directly from OS X (something I generally don't care to do anyways).

sformisano commented 9 years ago

UPDATE: I figured out the reason behind this issue and I'm posting it here for whoever may stumble upon the same problem. I would also love to hear if this is expected or if it could, like I think, be an issue.

I have a bash script that runs my project setup: it pulls dependencies in, a few more things and THEN, it generates mysql passwords with pwgen and replaces stubs in the docker-compose.yml file with them.

What this means is that obviously every time I run this setup I end up with different passwords in my docker-compose.yml setup

But that should be ok because the bash script runs the docker-compose up command, which as far as I know creates the containers from scratch. What I've observed, however, is that previously generated containers stick around in part.

Let me clarify this with the steps it takes to see the issue:

1) I create 'coolproject' with my bash script 2) The project sets everything up, and everything works. Mysql is up, the credentials are correct, the web service can connect to it, hurray. For reference, the mysql passwords generated in this step are 'first_pwd_root' and 'first_pwd_user' 3) If, for any reason, I fee like scaffolding my project from scratch, by removing files and running my bash script again, the NEWLY created containers will have the newly generated mysql passwords as environment variables (for reference, 'second_pwd_root' and 'second_pwd', BUT the actual mysql passwords will be the ones from the previous installation, i.e. 'first_pwd_root' and 'first_pwd'.

The docker-compose.yml resulting from step 3 will have 'second_pwd_root' and 'second_pwd' listed as passwords. An inspection on the containers will show 'second_pwd_root' and 'second_pwd' and environment variables, but despite all this, 'first_pwd_root' and 'first_pwd_user' are the passwords mysql is installed with.

I'm not sure this is the wanted behaviour so if anyone has any knowledge on this I'd love to hear whether this is a bug or a "feature" (perhaps to do with volume persistency).


Hey @med5 thanks for the answer. Since this conversation I've had a number of weird additional issues, but all I can say is that it seems the mysql image does not play well with docker-compose. I do remember reading about this in the mysql image readme, but I'm not sure anyone figured out a way around it? It'd seem a pretty important thing.

Right now, even without bind-mounting a directory, the container exits immediately and below you can see the logs (this is the mariadb image, I just gave it a shot yesterday hoping this would be unique to whatever the mysql image does but that's not the case). The env variables are set, it seems like the container can't run through its setup.

2015-03-19 13:31:18 1 [Warning] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive 2015-03-19 13:31:18 1 [Note] Plugin 'FEDERATED' is disabled. mysqld: Table 'mysql.plugin' doesn't exist 2015-03-19 13:31:18 1 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 2015-03-19 13:31:18 1 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-03-19 13:31:18 1 [Note] InnoDB: The InnoDB memory heap is disabled 2015-03-19 13:31:18 1 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 2015-03-19 13:31:18 1 [Note] InnoDB: Memory barrier is not used 2015-03-19 13:31:18 1 [Note] InnoDB: Compressed tables use zlib 1.2.7 2015-03-19 13:31:18 1 [Note] InnoDB: Using Linux native AIO 2015-03-19 13:31:18 1 [Note] InnoDB: Not using CPU crc32 instructions 2015-03-19 13:31:18 1 [Note] InnoDB: Initializing buffer pool, size = 128.0M 2015-03-19 13:31:18 1 [Note] InnoDB: Completed initialization of buffer pool 2015-03-19 13:31:18 7f38500ee720 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. 2015-03-19 13:31:18 7f38500ee720 InnoDB: Operating system error number 13 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. 2015-03-19 13:31:18 1 [ERROR] InnoDB: Creating or opening ./ibdata1 failed! 2015-03-19 13:31:18 1 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data! 2015-03-19 13:31:18 1 [ERROR] Plugin 'InnoDB' init function returned error. 2015-03-19 13:31:18 1 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 2015-03-19 13:31:18 1 [ERROR] Unknown/unsupported storage engine: InnoDB 2015-03-19 13:31:18 1 [ERROR] Aborting

2015-03-19 13:31:18 1 [Note] Binlog end 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'partition' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'BLACKHOLE' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'ARCHIVE' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_FIELDS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_INDEXES' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_SYS_TABLES' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_FT_CONFIG' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_FT_DELETED' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_METRICS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_CMPMEM' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_CMP_RESET' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_CMP' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_LOCK_WAITS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_LOCKS' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'INNODB_TRX' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'MEMORY' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'CSV' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'MRG_MYISAM' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'MyISAM' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'sha256_password' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'mysql_old_password' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'mysql_native_password' 2015-03-19 13:31:18 1 [Note] Shutting down plugin 'binlog' 2015-03-19 13:31:18 1 [Note] mysqld: Shutdown complete

yosifkit commented 9 years ago

It is a "feature" to preserve the volume. It looks like there is some documentation about preserving volumes on docker-compose up (https://docs.docker.com/compose/cli/#up).

Michael-Brooks commented 8 years ago

I too get this issue when running "docker-compose up" inside of the default Vagrant box. The memory is at 2GB and I tried upping the memory usage, but it still happens. I am using the latest Docker releases (updated today using the toolbox) and trying to pull the MySQL 5.5 image.

meticulo3366 commented 8 years ago

Hi,

Docker mysql keeps crashing for me, not sure what is going on as the containers are clean and I wipe all dockers volumes as well.

db_1        | Running mysql_install_db
db_1        | 2016-04-28 19:25:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
db_1        | 2016-04-28 19:25:32 0 [Note] /usr/sbin/mysqld (mysqld 5.6.30) starting as process 12 ...
dockermagic_db_1 exited with code 141

To Solve this issue i have to destroy and recreate the docker machine, its the only way to move past this error...

yosifkit commented 8 years ago

@meticulo3366, that looks like an older image from before 22nd Oct. 2015: https://github.com/docker-library/mysql/pull/109; have you tried docker pulling recently? (not sure if that will help)

It only fails to start sometimes for you? Because you mentioned docker-machine, one guess in that the VM in question does not have enough memory. The default mysql install is setup for at least 1GB if I recall correctly.

The error code given looks like it exited because of a SIGPIPE, though that seems strange given my guess at the line failing since there was no "Finished mysql_install_db": https://github.com/docker-library/mysql/commit/4797ba77f07cb8ccd650a888b072f1d9de89f439#diff-ce9d1cb24c18ab076ee178d2d9325debR24

ltangvald commented 8 years ago

@yosifkit That error is for mysql/mysql-server, not the official image

upbeta01 commented 8 years ago

I am encountering errors related to this, but issue occurs when using the volume binding option (-v). I run my docker environment on Mac (Yosemite).

Here is the log: http://hastebin.com/atodelisej.vhdl

I even tried doing some chmod testing for the host volume permission but still not working. I also checked the virtualbox shared folder is pointing to /Users with full access permission set. The default vm running has 2GB RAM which I assume big enough for running docker environment.

FYI: I was able to use the -v option on the webserver container running on the same host

Hope we to get more inputs about this issue...

ref: https://github.com/docker/machine/issues/1826 and https://github.com/docker/machine/issues/13

yosifkit commented 8 years ago

@upbeta01, can you try adding a --user to the docker run?

$ docker run --user 1000:50 -p 3306:3306 -v ~/docker/data-vol:/var/lib/mysql --net docknet --ip 192.168.200.11 -e MYSQL_ROOT_PASSWORD=toor -e MYSQL_DATABASE=development -e MYSQL_USER=dev -e MYSQL_PASSWORD=password --name mysql mysql:5.6
upbeta01 commented 8 years ago

@yosifkit adding the parameter --user seem to have fix the issue. I read something from before with regard to UID/GID which was a known issue on boot2docker (Mac Users). I was assuming this has been address on the update for boot2docker, which is what we now call docker-machine.

Nevertheless, you saved the day! Kudos..

godbout commented 8 years ago

I'm having the same problem as soon as I've started using mysql 5.7. If I use volume binding (with I have to), then mysqld_safe fails. The first error is the mysql.plugin table doesn't exist (my log is exactly the same as @sformisano (https://github.com/docker-library/mysql/issues/3#issuecomment-83580054). If I don't bind volume, it works perfectly. Rights are good. Not sure where to look for now.

ltangvald commented 8 years ago

What sort of location to you bind to? It's possible this is an issue with 5.7's --initialize, which will tend to refuse to run if there are files in datadir. This includes the LOST+FOUND directory that would be there if you bind to the top level of a partition.

ltangvald commented 8 years ago

You can try adding --ignore-db-dir="lost+found" to the run command and see if that helps

godbout commented 8 years ago

Hi! Sorry, my mistake, it was not a volume thing. The folders were empty but a part of my initialization script wasn't fully updated for 5.7. This, plus the now random root password etc etc etc. Dig into it, spent an afternoon, working fine now. Thanks for the help! 👍

yao23 commented 7 years ago

It works for me to delete unused images to release space in docker

tianon commented 6 years ago

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04

qedrakmar commented 6 years ago

Since this issue appears to be both dragging on, and related to the the underlying system instead of an issue with the image, I am closing this.

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.

maxime1992 commented 6 years ago

Finally figured out what was wrong for me. The post was the last of my arguments and it should be before the image that you want to use:

docker run --name your-image-name -e MYSQL_ROOT_PASSWORD=your-image-pwd -p 3306:3306 -d mysql

alberto56 commented 6 years ago

This was happening in my case because I was referencing a volume in docker-compose.yml

volumes:
  - "mysql:/var/lib/mysql"

But I was in swarm mode and the volume was not usable.