Download MySQL
- Access official website: https://www.mysql.com/
- Click on the "Downloads" tab
- At the bottom there is a "MySQL Community Edition (GPL)", click on "Community (GPL) Downloads?"
- Click "DOWNLOAD" under "MySQL Community Server (GPL) "
- Download "Windows (x86, 64-bit), ZIP Archive" on the page that pops up
Install MySQL
A compressed package is equivalent to a free install file, and you need to configure it correctly to use it, and start the database service through the service. 1. Unzip the package to your preferred location. This example extracts to: D:\mysql-5.7.13-winx64, Folder 2. Create a My.ini file with the following contents:
[Plain]View PlainCopy
- [Mysqld]
- port=3306
- Basedir = "d:\\mysql-5.7.13-winx64\\"
- DataDir = "f:\\mysqldata\\"
- Max_allowed_packet = 32M
Note that Basedir and DataDir are required to be configured, and Basedir is the directory you unzipped. The official document says that if you like to use a slash, you use a double slash, and you don't have to do that with a backslash. namely: d:\\mysql-5.7.13-winx64\\ or: d:/mysql-5.7.13-winx64/because I like to the database data file independent out, so put datadir configuration to other places, convenient management. Also, create the directory. 3. Configure Environment variables
- Add a variable called Mysql_home.
- Modify the path variable and add%mysql_home%\bin at the end
4. Installing the MySQL Service
- Run cmd as Administrator and go to the MySQL bin directory.
- Initializing the database file
[Plain]View PlainCopy
- Mysqld--initialize
After the initialization succeeds, some files are generated in the DataDir directory, where the Xxx.err file describes the root account's temporary password. That's about the length of the line:
[Plain]View PlainCopy
- 2016-07-24t05:19:20.152135z 1 [Note] A temporary password is generated for [email protected]: bl2uuwuf0h (X
That is, the password is: bl2uuwuf0h (X
[HTML]View PlainCopy
- Mysqld-install MySQL
[Plain]View PlainCopy
- net start MySQL
Use 3307 Login
Mysql-uroot-h127.0.0.1-p3307-p
Change Password
ALTER USER ' root ' @' localhost ' identified by ' New_password ';
Windows installation mysql5.7.17