Docker Community Forums

Share and learn in the Docker community.

Official mysql container


(Luis Vegerano) #1

Im having an issue with the mysql official container from docker hub. Every time I start the container I get

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

Someone told me that is a problem with the docker file, but I cant seem to find the Dockerfile. Any suggestion?

PS Im a complete n00b :smiley:


(Usertaken) #2

Use MariaDB.


(Jmorgan) #3

Hi there,

You’ll need to add an environment variable (working to make this easier). Kitematic can do this in the container settings pane.

Just add a new environment variable for MYSQL_ROOT_PASSWORD and hit save! Off to the races!

An important a heads up: at the moment the official mysql container doesn’t work with Kitematic due to a file permission issue (working on a patch as we speak that fixes this). Stay tuned to this issue here: https://github.com/kitematic/kitematic/issues/209

Jeff


(Jmorgan) #4

Just an FYI that the file permission issue is somewhat fixed.

With Kitematic 0.5.12+, if you start a new MySQL container it won’t automatically mount volumes and should work once you set the MYSQL_ROOT_PASSWORD environment variable.


(Angelnode) #5

How I can fix the problem on my ubuntu server?


(Angelnode) #6

I got the answer by http://www.sitepoint.com/how-to-manually-build-docker-containers-for-wordpress/


(Nsreekant) #7

Thanks Morgan. I noticed that this issue still persists (even in the Jan 2016 image) but gets resolved with the work around you suggested.
Adding the ‘MYSQL_ROOT_PASSWORD’ and a random value solves it and immediately runs MySQL.