Creating a new database instance on Windows (mysql_install_db.exe)

You are viewing an old version of this article. View the current version here.

mysql_install_db.exe utility is provided on Windows starting with MariaDB 5.2.6

Functionality

Its functionality is comparable with shell script mysql_install_db used on Unix, however it has been extended to both Windows specific functionality (creating Windows service), and to generally useful functionality - it can set 'root' user password during database creation, it creates configuration file my.ini in the data directory and adds most important parameters into it (e.g port). mysqld_install_db.exe is used by MariaDB installer, if "Database instance" feature is selected. It obsoletes similar utilities and scripts that were used in the past , like mysqld.exe --install, mysql_install_db.pl 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-accessAllows remote access from network for user root
-N, --skip-networkingDo not use TCP connections, use pipe instead

Note : to create Windows service, user should run as full administrator (which means elevated command prompt on systems with UAC)

Example usage

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

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

To start service from the command line, execute

  sc start MyDB

Removing databases instances

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

  sc stop <servicename>
  sc delete <servicename>
  del /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.