mysql_install_db.exe

The mysql_install_db.exe utility is the Windows equivalent of mysql_install_db.

Functionality

The functionality of mysql_install_db.exe is comparable with the shell script mysql_install_db used on Unix, however it has been extended with both Windows specific functionality (creating a Windows service) and to generally useful functionality. For example, it can set the 'root' user password during database creation. It also creates the my.ini configuration file in the data directory and adds most important parameters to it (e.g port).

mysql_install_db.exe is used by the MariaDB installer for Windows if the "Database instance" feature is selected. It obsoletes similar utilities and scripts that were used in the past such as mysqld.exe --install, mysql_install_db.pl, and mysql_secure_installation.pl.

ParameterDescription
-?, --helpDisplay help message and exit
-d, --datadir=nameData directory of the new database
-S, --service=nameName of the Windows service
-p, --password=namePassword of the root user
-P, --port=# mysqld port
-W, --socket=namenamed pipe name
-D, --default-userCreate default user
-R, --allow-remote-root-accessAllow remote access from network for user root
-N, --skip-networkingDo not use TCP connections, use pipe instead
-i, --innodb-page-sizeInnodb page size, since MariaDB 10.2.5
-s,--silentPrint less information
-o,--verbose-bootstrapInclude mysqld bootstrap output
-l,--large-pagesUse large pages, since MariaDB 10.6.1
-c,--configmy.ini config template file, since MariaDB 10.6.1

Note : to create a Windows service, mysql_install_db.exe should be run by a user with full administrator privileges (which means elevated command prompt on systems with UAC). For example, if you are running it on Windows 7, make sure that your command prompt was launched via 'Run as Administrator' option.

Example

  mysql_install_db.exe --datadir=C:\db --service=MyDB --password=secret

will create the database in the directory C:\db, register the auto-start Windows service "MyDB", and set the root password to 'secret'.

To start the service from the command line, execute

sc start MyDB

Removing Database Instances

If you run your database instance as service, to remove it completely from the command line, use

sc stop <servicename>
sc delete <servicename>
rmdir /s /q <path-to-datadir>

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.