-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql immediately stops after running #3
Comments
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> |
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:
|
I encountered this same issue today. Setup: Windows 7 64 bit 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. |
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 |
It looks to me like your machine is out of memory:
|
I try it again on a 1GB memory machine and it worked. Thank you |
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. |
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
Any other ideas that could solve such a huge memory footprint? |
MySQL 5.6 has changed the defaults to use more memory (and perform better): To use minimal memory: |
Thanks for the workaround, it worked for me too. |
@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? |
I'm +1 on this being a documentation problem. Generally, we should defer I'd also imagine that the majority of folks looking to seriously put MySQL |
@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. |
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 ( 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 |
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? |
@morgo are you willing to create a PR for the docs? As I see it, the (Just speaking for myself here, I'm not a maintainer 😄) |
My vote for branches: small,medium, huge etc... For my typical use , like wordpress in 500mb digital ocean its a disaster. |
The log is very confusing where it shows "Shutdown completed" twice before an attempt to start. Why that is so? |
+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. |
@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 |
@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. |
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. |
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: 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. |
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. |
Hi, I have the same problem.
I am a beginner at Docker and don't know how to correct this problem? |
@clarenced, If you are running on a Mac using boot2docker, you will probably need to increase the memory available to the VM: stackoverflow. |
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:
Running mysql_install_db ... 2015-03-08 04:14:28 14 [Note] Binlog end
"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. |
@upbeta01, can you try adding a
|
@yosifkit adding the parameter Nevertheless, you saved the day! Kudos.. |
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 (#3 (comment)). If I don't bind volume, it works perfectly. Rights are good. Not sure where to look for now. |
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. |
You can try adding --ignore-db-dir="lost+found" to the run command and see if that helps |
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! 👍 |
It works for me to delete unused images to release space in docker |
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. |
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:
|
This was happening in my case because I was referencing a volume in docker-compose.yml
But I was in swarm mode and the volume was not usable. |
Revert "Fix for bug#81723"
`2018-11-01T07:51:55.214905Z 0 [Warning] 'ERROR_FOR_DIVISION_BY_ZERO' mode is removed. Setting this will have no effect. 2018-11-01T07:51:55.844876Z 0 [Note] Binlog end my.cnf [mysqld] server-id = 1 key-buffer-size = 32M max-allowed-packet = 16M datadir = /var/lib/mysql/ log-bin = /var/lib/mysql/mysql-bin tmp-table-size = 32M innodb-flush-method = O_DIRECT #log-error = /var/lib/mysql/mysql-error.log |
i have to change the image of mysql, now it's work. |
If you've used mariadb and then swapped to mysql you may have issues starting. You may need to kill the volume and recreate it, warning you'll lose any data in that volume. https://linuxize.com/post/how-to-remove-docker-images-containers-volumes-and-networks/#removing-docker-volumes. I did this by |
Had the same issue. see https://stackoverflow.com/questions/45467988/docker-container-wont-start-with-mysql-docker-image |
Hello I have a similar issue... this is the command: The problem is: This is the container's log:
|
Hello, I'm having a similar issue of MYSQL exciting immediately after been ran on docker. I'm new to docker, please help
|
@anasey01 How are you running the container? |
@itangvald, I'm using the command
|
I am having the same issue, running docker 18.0.9 Do you have any solution? |
Im having the same problem, but after awhile the mysql container starts without problems. |
I am not sure but may be there is a problem with root privileges? or it requires something else? try to look through this thread or similar one |
General troubleshooting areas:
Locking old issue; please file a new issue if you can reproduce a bug with the image. For general help, it'd be better to post questions in the Docker Community Forums, the Docker Community Slack, or Stack Overflow. |
I run this command:
And I get this output:
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?
The text was updated successfully, but these errors were encountered: