安装mysql5.7

解压zip文件到以下目录:
C:\Users\zheng\Downloads\TechTool\mysql


配置my.ini,在c:/window目录下创建文件my.ini,内容如下:
[client]   
#password   = your_password   
port        = 3306  
#设置mysql客户端的字符集   
default-character-set = utf8   

[mysqld]
port=3306
# set basedir to your installation path
basedir=C:\\Users\\zheng\\Downloads\\TechTool\\mysql
# set datadir to the location of your data directory
datadir=C:\\Users\\zheng\\Downloads\\TechTool\\mysql\\data

character_set_server = utf8
explicit_defaults_for_timestamp=true



初始化data目录:
创建目录C:\\Users\\zheng\\Downloads\\TechTool\\mysql\\data
执行初始化命令:
mysqld --initialize
在data目录下会在*.err文件里面会生成临时密码


安装MySQL服务
"C:\Users\zheng\Downloads\TechTool\mysql\bin\mysqld" --install


使用临时密码登陆:
mysql -u root -p


设置新密码:
set password=password('123456');



参考文档:
https://dev.mysql.com/doc/refman/5.7/en/windows-install-archive.html 

你可能感兴趣的:(安装mysql5.7)