[Solution to Problem] MySQL fails to start after installation-net start mysql service name is invalid

Problem Description

  • Enter in cmdnet start mysql
  • prompt:服务名无效或者MySQL正在启动 MySQL无法启动

Analysis and solution

  • the reason

    • net start + service name, start the service registered under win. At this time, mysql is not registered in the system. That is, there is no mysql service in the current path.
  • How to register MySQL to win service?

    • Cmd under the bin path of MySQL, and entermysqld --install
    • Success: Service successfully install appears to indicate that you have successfully installed,
    • Unsuccessful: you need to run the DOS window as an administrator, so that you can succeed
  • Quickly open DOS as an administrator:

    • Method 1: Start Menu-Command Prompt-Right Click-Run as Administrator
    • Method 2: After creating the cmd shortcut, modify the properties of the shortcut—Advanced—Run as administrator.
    • Note: The cmd window opened in this way has to find its own path.
  • Follow up

    • The administrator window can start MySQL, and then open the ordinary cmd window still fails

summary

  • MySQL installation and startup need to be performed in the cmd window with administrator rights, otherwise there will be a series of problems later.

Reference link

END

Guess you like

Origin www.cnblogs.com/anliux/p/12742974.html