The mysql_install_db.exe
utility is the Windows equivalent of mysql_install_db.
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
, --
installmysql_install_db.pl
, and mysql_secure_installation.pl
.
Parameter | Description |
---|---|
-? ,
|
Display help message and exit |
-d ,
|
Data directory of the new database |
-S ,
|
Name of the Windows service |
-p ,
|
Password of the root user |
-P ,
|
mysqld port |
-W ,
|
named pipe name |
-D ,
|
Create default user |
-R ,
|
Allow remote access from network for user root |
-N ,
|
Do not use TCP connections, use pipe instead |
-i ,
|
Innodb page size, since MariaDB 10.2.5 |
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.
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
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>
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/mysql_install_dbexe/