MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL 5.7.6 DMR: Packages, Repos, Docker Images

We are getting closer to the next major version of MySQL, and yesterday we announced another development milestone release of what will become MySQL Server 5.7. In addition to the announcement blog post itself, more in-depth posts on specific changes and improvements in the 5.7.6 milestone release will appear on the MySQL Server Team blog over the next few days and weeks.

We have been busy in the packaging, deployment and configuration area for this milestone as well, and we have made several important improvements and changes that we’ll run through in this post.

Goodbye mysql_install_db, Hello mysqld –initialize

The MySQL bootstrap process has always been complex, relying on a Perl (shell in older MySQL versions) script called mysql_install_db to initialize the data directory, set up system tables and create the MySQL root account. This created unnecessary complexity and also required Perl to be available on the database host. As of 5.7.6 mysqld knows how to bootstrap itself, and mysql_install_db has been replaced by the much simpler –initialize option to mysqld. Or alternatively –initialize-insecure. More on the difference between those two options can be found in the section on data directory initialization in the MySQL Server 5.7 manual.

Besides a reduction in general complexity and improved robustness and error reporting, the big gain for packaging and deployment is that server bootstrap is now completely platform agnostic: no dependency on Perl any more, and in particular no need to handle Windows as a special case.

Another implication is that most of the initial configuration of MySQL is now done only with the privileges of the mysql system user. As a consequence, we are no longer able to write the random mysql root password to /root/.mysql_secret, and this now instead gets written to MySQL’s error log.

The father of –initialize, Georgi Kodinov, has a much more in-depth story on this over on the MySQL Server Team blog.

Native systemd Support

Up until this milestone, we used a somewhat suboptimal mix of mysqld_safe, mysqladmin and shell scripting to control mysqld on operating systems with systemd. As of 5.7.6, we have introduced a (platform agnostic) –daemonize option to mysqld, which allows mysqld to run as a traditional, forking UNIX daemon. This allows us to work natively with systemd’s service control and monitoring infrastructure, and the MySQL 5.7 manual has a new section about managing MySQL Server with systemd.

A related change is that we now offer native support for handling MySQL logging through syslog. This appeared in the previous 5.7.5 milestone release.

And Finally: Docker!

So what is the easiest way to try out the 5.7.6 milestone? There are packages on our download site and in our Linux repos, but there is another way that will also easily coexist with any existing MySQL instances that you may already have on your system and that you may not want to disturb: try the MySQL Docker images.

We are currently ramping up our work on Docker, both to help maintain and improve the very popular community supported set of MySQL images on Docker Hub, but also with our own set of images, which we will develop in some new directions and also use as a proving ground for changes and enhancements that we will propose for inclusion in the community images.

You’ll find instructions for pulling and running our images in the MySQL area on Docker Hub. We have 5.5, 5.6 and the latest 5.7 DMR all in there, and the tag that will get you 5.7 is simply “5.7″, or alternatively the more specific “5.7.6″. Add your desired container name and admin password to the following command line and you will be up and running with 5.7.6 in next to no time at all:

docker run --name my-container-name -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql/mysql-server:5.7.6

Suggestions, comments, issues? Please comment below, or submit a bug report to the MySQL bug tracker