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?


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.

  1. Run regedit. Export HKLM\SYSTEM\CurrentControlSet\Services\MySQL hive into .REG file.
  2. Edit this .REG file:
    • Replace all occurences of mysql with mariadb;
    • Edit ImagePath, set it to correct value (shown in your question as "Start mariadb server.").
  3. Import the result of your edition back into registry.
  4. Reboot (not nesessary but safe).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.