一、下载mysql免安装版
下载地址:https://cdn.mysql.com//archives/mysql-5.7/mysql-5.7.19-winx64.zip
可以需要下载指定版本:https://dev.mysql.com/downloads/mysql/
二、安装
1、解压安装包,比如本人解压目录为:D:softmysql-5.7.19-winx64,在根目录下新建my.ini文件,内容为
[client] port=3306 default-character-set=utf8 [mysqld] basedir=D:\softmysql-5.7.19-winx64 datadir=D:\softmysql-5.7.19-winx64data port=3306 character-set-server=utf8 character-set-filesystem = utf8 sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER explicit_defaults_for_timestamp=true skip-grant-tables
2、管理员打开cmd,进入mysql解压目录
# 安装mysql服务 mysqld -install # 初始化mysql mysqld --initialize-insecure # 启动mysql服务 net start mysql
3、登陆mysql,修改密码,可以配置mysql环境信息到环境变量中
# cmd下登陆 mysql -u root # mysql控制台刷新权限 flush privileges; # 修改密码 alter user root@localhost identified by "123456"; # cmd下重新登陆,输入密码123456 mysql -u root -p
yexiangyang
moyyexy@gmail.com