1. Download address:
/downloads/mysql/
1. Enter the official website to download, the latest version should be displayed, and select the second one (mysql5.7.)
2. After the download is completed, decompress it directly to the custom directory. The decompressed directory is the installation directory.
2. Configure environment variables
1. Add new environment variables, example:
Variable name: MYSQL_HOME
Variable value: D:\mysql\mysql5.7.20-winx64
2. Modify the environment variable PATH
Add %MYSQL_HOME%\bin after PATH, Note: Adding new variable values requires separation
3. Add configuration files
1. There is no configuration file or data folder in the downloaded compressed file. You need to manually create new text in the bin directory. If placed in the root directory, data cannot be automatically generated (it has been tricked for a long time). The content is as follows:
[client] default-character-set=utf8 [mysqld] #Extract directory basedir = %MYSQL_HOME% #Extract directory datadir = %MYSQL_HOME%\data port = 3306 default-character-set=utf8
4. Initialize mysql and start mysql service
1. Run the command line cmd as administrator and enter the bin directory (must enter the bin directory)
example:cd D:\mysql\mysql5.7.20-winx64\bin
2. Enter the command: mysqld
--initialize-insecure (generates root user without password)
A data folder will be generated in the root directory with files inside it
3. Start the service: net start mysql, stop the service: net stop mysql
The mysql service started successfully
4. Set mysql password
mysqladmin -u root password password
5. Success
Others: Remove the service command, in the bin directory (mysqld --remove)
Summarize
The above is a simple tutorial on downloading and installing Mysql 5.7.20 compressed version introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!