How to create a service to start my mariadb?

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.