I installed mysql and mariadb in the same pc(win10).Port 3306 binded with mysql, 3307 with mariadb.
net start mysql #start mysql server.Start mariadb server.
F:/mariadb-10.3\bin\mysqld --defaults-file=F:/mariadb-10.3\mysql\my.ini --user=root Start it in background.
start /B F:/mariadb-10.3\bin\mysqld --defaults-file=F:/mariadb-10.3\mysql\my.ini --user=root Now i want to create a service such as net start mysql
net start mariadb How to make it in windows10?
3 Answers
Use the sc command from a command prompt to add MariaDB to services.
sc create MariaDB binpath= "F:/mariadb-10.3/bin/mysqld --defaults-file=F:/mariadb-10.3/mysql/my.ini" DisplayName= "MariaDB" start= "auto"You probably don't need the --user=root in the command when running it as a service. It's usually not needed.
- Run regedit. Export
HKLM\SYSTEM\CurrentControlSet\Services\MySQLhive into .REG file. - Edit this .REG file:
- Replace all occurences of
mysqlwithmariadb; - Edit ImagePath, set it to correct value (shown in your question as "Start mariadb server.").
- Replace all occurences of
- Import the result of your edition back into registry.
- Reboot (not nesessary but safe).
please look it very easy, just open your CMD as Administrator and type :
mysql_install_db.exe --datadir=F:/mariadb-10.3/bin/mysqld --service=MariaDB --password=secret