MySQL 5.6 for Windows decompressed version configuration installation

MySQL 5.6 for Windows decompressed version configuration installation

Everyone knows that MySQL is a small but powerful database, which is very popular at present. However, the installation package given by the official website has two formats, one is msi format and the other is zip format. Many people unzip the zip format and find that there is no setup.exe, and they are confused in the face of a bunch of files, and they don't know how to install it. The MySQL in msi format can be completed by double-clicking and following the installation steps. In fact, the zip format can be used directly, but you must configure the operating environment on your computer first, otherwise the service will definitely not be able to start. I will introduce how to Solve various problems during installation in this case
Tools /Materials

win10操作系统

MySQL zip格式安装包

method/step

step 1.

There are two types of MySQL installation files, one is in msi format and the other is in zip format. If it is in msi format, you can directly click to install and install it according to the installation prompts it gives (I believe everyone can understand English prompts in English). Generally, MySQL will be installed in the directory C:\Program Files\MySQL\MySQL Server 5.6 Medium; the zip format is decompressed by itself. After decompression, MySQL can be used, but it needs to be configured.

Step 2

.After unzipping, you can rename the folder and put it in a suitable location. Personally, I suggest renaming the folder to MySQL Server 5.6 and putting it in the C:\Program Files\MySQL path. Of course, you can put it anywhere you want.
write picture description here

Step 3

.After completing the above steps, many users start to use MySQL, but the error shown in the figure will appear. This is due to no environment variables being configured. Configuring environment variables is easy:
My Computer -> Properties -> Advanced -> Environment Variables
write picture description here

Select PATH and add after it: the path of your mysql bin folder (eg: C:\Program Files\MySQL\MySQL Server 5.6\bin )

PATH=…….;C:\Program Files\MySQL\MySQL Server 5.6\bin (note that it is appending, not overwriting)
write picture description here

Don't start mysql after configuring the environment variables, we also need to modify the configuration file (if there is no configuration, the error in the figure will appear when starting!: Error 2 The system cannot find the file), mysql-5.6 .1X The default configuration file is in C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini, or create a my.ini file yourself,

Modify or add configuration in it (as shown in the figure):
write picture description here
modify it to:

basedir=C:\Program Files\MySQL\MySQL Server 5.6(mysql所在目录) 
datadir=C:\Program Files\MySQL\MySQL Server 5.6\data (mysql所在目录\data)

Run cmd as an administrator (be sure to run it as an administrator, otherwise the permissions are not enough),

Step 4

.Enter: cd C:\Program Files\MySQL\MySQL Server 5.6\bin to enter the bin folder of mysql (regardless of whether the environment variable has been configured, also enter the bin folder, otherwise the service will still report error 2 after starting the service)

输入mysqld -install(如果不用管理员身份运行,将会因为权限不够而出现错误:Install/Remove of the Service Denied!) 

write picture description here
Successful installation
write picture description here

Step 5

. After the installation is successful, the service will be started. Continue to enter: net start mysql in cmd (as shown in the figure). The service starts successfully!

At this time, many people will have errors, please see Note:
Note: Error 2 and Error 1067 often appear at this time.
If "Error 2 The system cannot find the file" appears, check whether the configuration file has been modified or whether you have entered the bin directory to operate. If the configuration file has been modified correctly and entered the bin folder, you need to delete mysql (input mysqld -remove) Reinstall (input mysqld -install);
if error 1067 occurs, it is the configuration file modification error, and confirm whether the configuration file is correct.
write picture description here
After the service is successfully started, you can log in, as shown in the figure, enter mysql -u root -p (the first login has no password, just press Enter), the login is successful!

Note:

If C:\WINDOWS\system32>net start mysqll appears System error 1058
occurs .
The service could not be started, either because it is disabled or because its associated device is not started.
Or
C:\WINDOWS\system32>net start mysql
System error 2 occurred.
The system can not find the file specified.
The reason for the analysis is that mysql will find the MySQL execution file on the c drive by default, and the path is wrong. You can first check whether the execution path of the MySQL service is consistent with the MySQL path we installed.
write picture description here
If it is inconsistent, the path is wrong, and the MySQL file in the registry needs to be modified. The imagepth is its own MySQL bin path.
write picture description here
Steps: Win+r to open the run command, enter regedit to enter and exit the registry, and check MySQL. The path is: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MySQL.

The above are some of the problems I have encountered and summarized. If there are any shortcomings or errors, please correct me. Welcome to exchange.

Guess you like

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