Mysql 5.7. 20 Compressed Edition Download and Install Simple Tutorial
- 2021-09-16 08:20:24
- OfStack
1. Download address:
http://dev.mysql.com/downloads/mysql/
https://www.ofstack.com/softs/451120.html1. Go to official website to download, and the latest version should be displayed. Select the second version (mysql5.7. 20-winx64.zip)
2. After downloading, unzip it directly to the custom directory, and the unzipped directory is the installation directory
2. Configure environment variables
1. Add environment variables, for example:
Variable name: MYSQL_HOME
Variable values: D:\ mysql\ mysql5.7. 20-winx64
2. Modify the environment variable PATH
Add% MYSQL_HOME%\ bin after PATH. Note: Adding new variable values requires; Separate
3. Add my. ini configuration file
1. There is no my. ini configuration file and data folder in the downloaded compressed file, so you need to manually create a new text my. ini in the bin directory. If you put it in the root directory, data cannot be automatically generated (pit me for a long time), my. ini, the contents are 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 an administrator and enter the bin directory (1 must enter the bin directory)
Example:
cd D:\mysql\mysql5.7.20-winx64\bin
2. Enter the command: mysqld
--initialize-insecure (生成无密码的root用户)
Generates an data folder with files in the root directory
3. Start service: net start mysql, stop service: net stop mysql
mysql service started indicates success
4. Set the mysql password
mysqladmin -u root password 密码
5. Success
Others: Remove the service command in the bin directory (mysqld--remove)
Summarize