- 使用文件名:mysql-5.7.11-winx64.msi
- -参考链接:
- https://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html
- https://www.cnblogs.com/arraylist/p/6726614.html
- 安装 -/- 解压
- 设置环境变量,非必须,就是为了省事儿,${installationPath}in
- win+x,A,cmd 管理员方式运行
- 生成 ${installationPath}data 目录
- >mysqld --initialize 生成带有随机密码的 root 用户
- >mysqld --initialize-insecure 生成无密码的 root 用户
- 复制 ${installationPath}my-default.ini 并重命名为 my.ini
17 # These are commonly set, remove the # and set as required.
18 # basedir = ..... # 安装目录
19 # datadir = ..... # 数据库数据存放目录
20 # port = ..... # 端口号
21 # server_id = ..... # 记得去掉注释
- cmd>mysqld --install
- cmd>net start mysql
- cmd>mysql -uroot -p
- mysql>set passwoed = password('yourPassword');
- 基本结束