WL#7688: Deprecate mysql_install_db and create a new program in C++

Affects: Server-5.7   —   Status: Complete

Background

mysqld can't bootstrap itself completely, mysql_install_db is a tool run
before mysqld has started first time. After execution server is fully functional
root account created and server secure deployed.

Scope

WL is about rewriting tool in C/C++ (from perl/bash) and at the same
time redesign to give better user experience, cover more needs and
being more secure, while still offering legacy features.
Owners of actual deliverable / packages (RE team) will give provide
input of required features of mysql_install_db. Needs of QA team is also
of importance.

Benefits

More secure by default
Remove perl dependencies
Implemented in same language as rest of server
systemd support/other init system support
Better support of configuration management tools
Improved testing
Better user experience
One step install, no post processing

F-1 The function of the program is to create the initial datadir and populate it with the system tables of the mysql server

F-2 The program must be able to execute from anywhere within the file system given correct options

F-3 The program must create the default admin account

F-4 Default admin account must have a randomized password per default

F-5 Generated passwords can be saved on disk but must then be expired

F-6 The default admin account is root@localhost

F-7 The program must compile and run on all supported platforms

F-8 Created files and directories can be created such that they are owned by an user id specified on the command line iff the effective user id has sufficient privileges

F-9 Program must support the creation of a non-default admin account with an empty password

F-10 The program depend on external tools. There must exist option(s) to specify the location of a well known layout providing each of those tools

NF-1 The program must be written in C/C++

F-11 The program needs to work with a "binary layout" (i.e. the result of cmake install or dedicated binary installers)

F-12 The program needs to work with a "source layout" (i.e. the result of compiling a source tree or a source package)

F-13 The program needs to work with an out-of-source build for a source layout

F-14 If neither layout is specified explicitly the program assumes it's operating on a "binary layout" and tries to detect it looking at the current directory, the directory it's in, MYSQL_HOME, and the compiled in defaults.