We can start MySQL service from windows command line using the below command.
net start mysql
Command to stop MySql service:
net stop mysql
Disable MySql service:
sc config mysql start= disabled
Command to enable MySql service(to automatically start MySQL service when the system starts up):
sc config mysql start= auto
Command to set the startup type to manual:
sc config mysql start= manual
How to restart MySql service?
There is no direct command to restart a service. You can combine stop and start commands like below.
net stop mysql & net start mysql
Related Posts:
How to connect to MySQL server from windows command line
How to install Mysql in Windows 7
first open your command propmt and then goto MySql’s bin . Then type mysqld and press enter . You server will be started.
Sir mySQl Services are stopped automatically. Due to this website is going down? How to fix this?
If your host is Windows, you can run the below command to keep it running all the time.
If it goes down even with this configuration, then I guess the sql service is crashing for some reason. Check if you have latest version of mysql.
[quote]Command to set the startup type to manual:
[code]sc config mysql start= manual[/code][/quote]
This is not accurate, according to Microsoft’s documentation [url=https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-config]Here[/url], the cmd entry should be:
[code]sc config mysql start= demand[/code]
Still, though, thank you for this!