window install mysql
1 Download mysql
You can go to MySQL official website to download: https://dev.mysql.com/downloads/mysql/
If the download speed of the official website is too slow, you can try Baidu cloud disk download:
Link: https://pan.baidu.com/s/15caKX2b2iSucm9jTlDWoRw
Extraction code: ix4o
2 configuration
Unzip the zip file
Create my.ini in the mysql root path
[mysqld]
# 设置3306端口
port=3307
# 设置mysql的安装目录
basedir=D:\mysql\mysql-5.7.25-winx64
# 设置mysql数据库的数据的存放目录
datadir=D:\mysql\mysql-5.7.25-winx64\mysql-5.7.25-winx64\data\
# 允许最大连接数
max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
# 服务端使用的字符集默认为UTF8
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
#如果不想设置密码可以配置
#mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[client]
# 设置mysql客户端连接服务端时默认使用的端口
port=3307
default-character-set=utf8
3 Installation
1 initialization
Open cmd as an administrator to run the command (note that the path must be written correctly):
D:\dev\mysql\mysql-5.6.39-winx64\bin\mysqld --initialize
2 Installation
Run the command mysql5_6 is the service name after installation
D:\dev\mysql\mysql-5.6.39-winx64\bin\mysqld install mysql5_6
3 Start Mysql
net start mysql5_6 #注意服务名要和之前一致
Then mysql will generate the xxx.err file in the storage directory and there will be mysql default password:
A temporary password is generated for root@localhost: zq/SYolsd15T
zq/SYolsd15T is the default root user password and can be linked with the tool
4 Change password
After entering mysql, run the following command to modify the password of the root user
set password for root@localhost=password('xxxxxx');