Home  >  Article  >  Database  >  What should I do if mysql cannot connect to the server?

What should I do if mysql cannot connect to the server?

藏色散人
藏色散人Original
2020-11-03 10:12:0523082browse

The solution to the problem that mysql cannot connect to the server: first open cmd as an administrator; then enter the bin directory where mysql is installed and execute "mysqld.exe -install"; then find MySQL in the service; finally execute the command " mysqld --initialize".

What should I do if mysql cannot connect to the server?

Recommended: "mysql video tutorial"

The error I encountered is as shown below: ( Unable to connect to the server, MySQL cannot be found in the service, and an error is reported when entering net start mysql in cmd)

Solution:

Open as administrator cmd, enter the bin directory of mysql installation and execute mysqld.exe -install

Then we can find MySQL in the service

If cmd and then enter net start mysql fails to start, you can try entering the following command:

mysqld --initialize     //在5.7需要初始化data目录

Finally successful

The above is the detailed content of What should I do if mysql cannot connect to the server?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn