MySQL Database connection failed
1. Use Navicat preiumn to connect to the local MySQL failed to find the cause, MySQL database service is not enabled, but in the list of services do not find the corresponding MySQL service.
So in the CMD interface, point the current path to the MySQL installation directory below: My local (C:\Program files\mysql\mysql Server 5.7\bin)
Execute with command by: Mysqld-install
The service follows OK and can be seen in the Windows Services list:
The net start MySQL command still does not start:
Why is this? Because the startup service has not been initialized, My.ini is not added to the data file
Put this My.ini file in the bin file installed in the MySQL directory.
Finally execute mysqld--initialize--user=mysql--console This command,
This initial password to remember, the following will be used
Next install the MySQL service: Execute command: mysqld--install
Installation success!!
Enter the database, execute the command: Mysql-uroot-p Enter the password just now
Service started successfully, PS: If there is no boot OK, manually under the service list startup
In this way, service up ...
MySQL Service failed to start