MySQL 5.7.18 Win x64安装
1. 下载地址
https://cdn.mysql.com/Downloads/MySQL-5.7/mysql-5.7.18-winx64.zip
2. 解压到
D:\mysql-5.7.18-winx64\
3. 新建D:\mysql-5.7.18-winx64\my.ini 配置文件
# MySQL Server Instance Configuration File
[mysqld]
#Path to installation directory. All paths are usuallyresolved relative to this.
basedir="D:\mysql-5.7.18-winx64"
#Path to the database root
datadir="D:\mysql-5.7.18-winx64\data"
4. 初始化MySQL数据库
mysqld --defaults-file="D:\mysql-5.7.18-winx64\my.ini" --initialize-insecure --user=mysql
5. 注册MySQL为系统服务
mysqld --install MySQL
6. 启动/停止服务
net start mysql / net stop mysql
7. 进入MySQL控制台
mysql -u root -p
8.修改默认密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';