- mysql 官网下载windows zip 安装包 并解压 (D:wampmysql-56-winx64)
- 添加path D:wampmysql-5722-winx64bin
- 创建data目录 D:\\wamp\\mysql-56-winx64\\data
-
创建mysql 配置文件 D:wampmysql-56-winx64my.ini
[mysqld] # set basedir to your installation path basedir=D:\\wamp\\mysql-56-winx64 # set datadir to the location of your data directory datadir=D:\\wamp\\mysql-56-winx64\\data
- cmd 执行 mysqld --initialize (初始化)
- 执行 mysqld --install mysql57 --defaults-file= D:wampmysql-56-winx64my.ini
(安装到windows 服务 mysqld --remove mysql57 移除服务 ) -
查看安装日志文件 D:wampmysql-5722-winx64dataMY-HOME.err 找到
**A temporary password is generated for root@localhost:** 后面是你的密码
8.mysql -uroot -p上面查到的密码
进入数据库
- SET PASSWORD FOR 'root'@'localhost'= "123456"; --更新你的mysql 密码