MySQL5.7 ZIP 安装
- 解压zip
- 配置系统环境变量:MYSQL_HOME,加入%MYSQL_HOME%\bin到PATH中
- bin\mysqld --install,提示安装服务成功
- 新建my.ini配置文件
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
port=3306
# set basedir to your installation path,安装目录
basedir=D:\\MySQL\\mysql-5.7.43
# set datadir to the location of your data directory,数据目录
datadir=D:\\MySQL\\mysql-5.7.43\\data
# 允许最大连接数
max_connections=10
character-set-server=utf8
default-storage-engine=INNODB
- bin\mysqld --initialize --console,根据my.ini配置mysql,生成数据目录,初始密码
- net start mysql,启动服务
- mysql -u root -p,登录
- ALTER USER 'root'@'localhost' IDENTIFIED BY 'new-password';,设置新密码
mysql5.7 zip 安装官方文档 https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization.html