Mysql service can not start, Can not connect to Mysql server on localhost 10038

When connecting to the database using Navicat, it found it impossible to connect the local database;

When you click to start MySql service in computer management, failed to start;

Use Run as Administrator cmd, enter net start mysql after opening, displaying invalid service name, type XXX for more help.

Then useless after input.

Switch to the installation directory of Mysql in the bin folder, enter the mysqld --remove, displays the service successfully removed;

Next, initialize MySql database, input mysqld --initialize --user = root --console;

Given the lack of data folder, create a folder data in MySql Server 8.0 folder to view my.ini configuration file specifies the file name is correct datadir

Mysql start again, continuing an error.

Another problem is my.ini encoding format changes when you modify the content my.ini file encoding format into a UTF-8-BOM,

Use Notepad to open the configuration file, see the code, change the encoding UTF-8 encoding, Mysql start again, indicating success.

 

Published 36 original articles · won praise 19 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_27182767/article/details/104009797