Environment:
System environment |
Windows 10 64-bit |
MySQL version |
5.7.19 |
One, million changes in the download
Download page: https://dev.mysql.com/downloads/mysql/
Click the Download button to download the ZIP package to the local, unzip (in my local decompression path is D:\db\mysql-5.7.19-winx64 For example, the location can be customized)
Second, configure environment variables
Take my local decompression path as an example of D:\db\mysql-5.7.19-winx64:
This computer--right----Advanced system settings--environment variables--System Variables-->path--> edit--New--fill in the D:\db\ Mysql-5.7.19-winx64\bin "-Confirm
Third, configure the MySQL configuration file
Create a new My.ini configuration file in MySQL decompression directory
The contents are:
[mysql]# set MySQL client default character set Default-character-set=utf8 [mysqld] #设置3306端口port = 3306# Set the installation directory for MySQL basedir=d:/db/ mysql-5.7.19-winx64# set the data storage directory for the MySQL database datadir=d:/db/mysqldata# the 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
Other configuration items are set according to their own needs and are not explained here.
Iv. Configure the service and start 1. Run cmd as Administrator and go to the bin directory in the extracted directory
2. Installing the MySQL Service
Mysqld Install
3. Initialize:
Mysqld--initialize
4. Turn on the service
net start MySQL
5. Find the initial password
MYSQ in the 5.7 version, the root user generates a temporary login password, which is generated in the. err file in the data directory, and the data directory I wrote in the My.ini configuration file is:
Datadir=d:/db/mysqldata
So find the file:
The part that is circled above is the login password.
If you do not have the file, try logging in with the wrong password once MySQL
Mysql-uroot-p
Enter an incorrect password and come back to see if there are any sheng.err files
6. Modify the initial password
First log in to root with the default initial password
Mysql-uroot-p
Enter a default password
Change Password:
Mysql> Set password for user name @localhost = password (' new password ');
mysql> Set password for [email protected] = password (' 123456 ');
The password modification succeeds after displaying OK.
Windows System mysql-5.7.19 official Green Edition Zip package installation Tutorial