The use command of mysql (2) MySql free installation version installation and configuration, with the solution that the MySQL service cannot be started

After sql is installed, there are many problems, which are solved one by one below

1. The mysql service cannot be started

The environment has been configured, but it has been started (run the command line as an administrator, enter: net start mysql)

Solution: open the service: find mysql Then we will find that there are two mysql services, one is mysql and the other is mysql57

 Delete both mysql and mysql57 services

Command: sc delete service name

Reference link: https://zhidao.baidu.com/question/942043067238613092.html  

I installed mysql5.7 why there is mysql in the service 

Enter the mysql installation directory through the command

then install the service

Service installed successfully

After the installation is successful, we will find that the mysql service has been started in the service

Then we started the service and found that it was just started and then shut down

we continue to solve

https://www.cnblogs.com/cenwei/p/6249856.html

MySql free installation version installation configuration, with the solution that the MySQL service cannot be started

Find the sixth step and find that the error is exactly the same. Test it according to the method he gave and it will be successful.

 Solution: After installing MySQL, open the cmd command window, enter the bin directory in the MySQL installation directory, and then enter the following command and press Enter: mysqld --initialize-insecure --user=mysql
After executing the above command, MySQL will build a data folder by itself, and build a default database. The login user name is root and the password is empty. After that, you can start the mysql service through the command net start mysql.
          Note: There is no data folder when MySQL is upgraded to version 5.7. Executing the mysqld --initialize-insecure --user=mysql command will automatically create a new data folder.

Neither the unzipped version nor the installation board have a data folder

Enter in the command line: mysqld --initialize-insecure --user=mysql

Let's take a look at the mysql installation directory and find that a data folder has been created

Since we initialized the database in the above operation, now the password for our database is empty

Then the following image will appear:

show databases (show databases ) mysql database commands must end with a semicolon ";")

Set a password for the database:

The tutorials on the installation online have been set up for a long time and have not been successfully set up. Suddenly, I use the database management tool to set it up.

I am using Navicat for mysql to create a new connection, do not fill in the password

Select user root to modify

 

Go to the command line to try it and found that it was successful haha

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324831429&siteId=291194637