How to install MySQL 5.7.18 Zip version
This version of MySQL is not like that click can be installed immediately, the next step is OK, this need to configure themselves, although a little trouble, I prefer to use this version, because relatively single, not because of the installation of the database, but also to install other plug-in tools.
1. Download path
Official website mysql zip file: https://dev.mysql.com/downloads/mysql/
Click the Download button, follow the prompts to download, do not login account; (download files to, such as: d:\\)
2. Unzip the mysql-5.7.18-winx64.zip downloaded to d:\\After the decompression is complete, the MySQL file directory address is: d:\\mysql-5.7.18-winx64
3. Configuring System Environment VariablesIn the computer configuration, the system environment variable is added, mysql_home:d:\\mysql-5.7.18-winx64 is added after path;%mysql_home%\bin
4. my.ini files required to add MySQL installation ServicesCreate the file under directory d:\\mysql-5.7.18-winx64 My.ini put the following code in the My.ini file and save
[JavaScript]View PlainCopy
- [MySQL]
- # Set the MySQL client default character set
- Default-character-set=utf8
- [Mysqld]
- #设置3306端口
- Port = 3306
- # set up the MySQL installation directory
- Basedir=d:\mysql-5.7.18-winx64
- # Set up a storage directory for MySQL database data
- Datadir=d:\mysql-5.7.18-winx64\data
- # Maximum number of connections allowed
- max_connections=200
- # The character set used by the service side defaults to the 8-bit encoded latin1 character set
- Character-set-server=utf8
- # The default storage engine that will be used when creating a new table
- Default-storage-engine=innodb
The file mentions Basedir and Datadir:basedir: it refers to the root directory of MySQL, DataDir: It is worth the data storage directory of the subsequent database, so it is necessary to create the folder in the MySQL root directory (you can create the directory location according to your actual idea. But the configuration in the file needs to be consistent) created files and folders, the file list is as follows:
5. Initializing the databaseOpen Cmd.exe, must run as administrator, because the environment variables have been configured, the following command can be performed successfully: Mysqld--initialize--user=mysql--console Remember the assigned password, the first time you log in to use:
6. Install the MySQL backend serviceExecute the command in the CMD terminal of the previous step: Mysqld--install MySQL57
7. Start the MySQL system service
net start MySQL57 Note: The above steps can be successfully installed, the following other possible commands to stop the service: net stop MySQL57 Delete Service: SC delete MySQL57 (executable when the problem occurs) may occur MSVCP12 0.dll missing install Vcredist_x86.exe or Vcredist_x64.exe, depending on your system. Other questions if you execute the SC delete MySQL57 command, remember to clear all files under the Data folder. If the net start MySQL57 instruction is executed, the following occurs: ' MySQL service is starting. The MySQL service could not be started. The service did not report any errors. ' To configure the environment variable or the environment variable configuration is wrong, please check carefully.
8. Login for the first time and change the passwordLogin with initial password: Mysql-u root-p After successful landing, use show databases; Command found not available, prompted to reset Password: set password for [email protected]=password ("Your password")
9. Congratulations on completing the MySQL zip version of the installation task
How to install MySQL 5.7.18 Zip version