最近我想在我的電腦上通過cmd啟動mysql服務,但卻發現了一個問題:服務名無效。
C:\>net start mysql System error 1060 has occurred. The specified service does not exist as an installed service.
我嘗試了很多方式去解決這個問題,包括:
C:\>sc query SERVICE_NAME: mysql5 ... C:\>sc start mysql5 [SC] StartService FAILED 1058: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
但是這些方法都沒有解決問題。最后,我發現了一個簡單的解決方法:
C:\mysql\bin>mysqld --install Service successfully installed. C:\mysql\bin>net start mysql The MySQL service is starting. The MySQL service was started successfully.
我通過在mysql的bin目錄下使用mysqld命令,成功安裝了mysql服務。
如果你也遇到了類似的問題,可以嘗試這種解決方法。