-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Hi there !
I tried to run mysql:5.5 by following the documentation on dockerhub talking about "custom configuration file".
I executed something like :
docker run --name my-mysql -v /my-conf/conf.d:/etc/mysql/conf.d -e MYSQL_RO OT_PASSWORD=blah -d mysql:5.5
But it failed like this :
150703 14:39:17 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.44) starting as process 62 ...
150703 14:39:18 [Note] /usr/local/mysql/bin/mysqld (mysqld 5.5.44) starting as process 68 ...
150703 14:39:18 [Note] mysqld (mysqld 5.5.44) starting as process 72 ...
150703 14:39:18 [Note] Plugin 'FEDERATED' is disabled.
150703 14:39:18 InnoDB: The InnoDB memory heap is disabled
150703 14:39:18 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150703 14:39:18 InnoDB: Compressed tables use zlib 1.2.3
150703 14:39:18 InnoDB: Using Linux native AIO
150703 14:39:18 InnoDB: Initializing buffer pool, size = 128.0M
150703 14:39:18 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
150703 14:39:18 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
150703 14:39:18 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...
150703 14:39:18 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
150703 14:39:19 InnoDB: Waiting for the background threads to start
150703 14:39:20 InnoDB: 5.5.44 started; log sequence number 0
150703 14:39:20 [Note] Event Scheduler: Loaded 0 events
150703 14:39:20 [Note] mysqld: ready for connections.
Version: '5.5.44' socket: '/tmp/mysql.sock' port: 0 MySQL Community Server (GPL)
150703 14:39:20 [Note] mysqld: Normal shutdown
150703 14:39:20 [Note] Event Scheduler: Purging the queue. 0 events
150703 14:39:20 InnoDB: Starting shutdown...
150703 14:39:22 InnoDB: Shutdown completed; log sequence number 1595675
150703 14:39:22 [Note] mysqld: Shutdown complete
150703 14:39:22 [Note] mysqld (mysqld 5.5.44) starting as process 1 ...
150703 14:39:22 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
150703 14:39:22 [ERROR] Aborting
150703 14:39:22 [Note] mysqld: Shutdown complete
+ DID='Running mysql_install_db
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password '\''new-password'\''
/usr/local/mysql/bin/mysqladmin -u root -h 4b17b18eca65 password '\''new-password'\''
Alternatively you can run:
/usr/local/mysql/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.
Please report any problems at http://bugs.mysql.com/
Finished mysql_install_db
I suspect it to be due to file /etc/mysql/conf.d/docker.cnf
not being there anymore because of my mounted volume.
Typically, we can see that mysqld's user is injected into this script.
If I define myself a user=mysql
in my configuration file, it solves the problem.
I think it would be worth to either mention this case in the doc, or not generate this user=mysql
stuff into the conf.d/
configuration file (or maybe include 2 different files in 2 separate directories in order to avoid this issue).