Reputation: 3100
I have installed MySql on my windows computer. I don't want the server to automatically start when I boot my computer. How can I get it to start manually through a shortcut?
I can go to services.msc
and there start the MySql server. This works but is a bit of work. So I would prefer to add a shortcut to my desktop for this. Therefore, I wanted to use mysqld
in the command prompt. But that way it does not seem to work. I get the error below. Does anyone see what I am doing wrong?
C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld
2019-11-26T19:29:37.816017Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.18) starting as process 2388
2019-11-26T19:29:37.820757Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2019-11-26T19:29:37.821037Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2019-11-26T19:29:37.821235Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory)
2019-11-26T19:29:37.850277Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-11-26T19:29:37.850574Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.18) MySQL Community Server - GPL.
Upvotes: 1
Views: 1282
Reputation: 272386
This probably belongs to superuser but anyway:
Make sure that MySQL service appears in services.msc and note down its name (MySQL, MySQL57, or similar). Create a shortcut on desktop using the following as location of the item:
%comspec% /c "net start mysql || pause"
Once the shortcut is created, you can change its name and/or icon. The shortcut must be opened as administrator (right click > run as administrator). Or you can change the shortcut setting to run as administrator.
Upvotes: 2