下载mysql-5.7.9-winx64.zip
编辑my.ini,设置basedir,datadir
安装为服务
mysqld --install MySQL5.7.9 --defaults-file=E:\my.ini
sc delete MySQL5.7.9
安装初始化数据库(mysql5.7以后默认没有data和script,需要手工安装)
mysqld --defaults-file=E:\my.ini --initialize
初回登录。查看server error log,获取随机密码
mysql -u root -p
Enter password: (enter the random root password here)
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
SET PASSWORD FOR 'root'@'%' = PASSWORD('xxxx');
flush privileges;
阅读(1792) | 评论(0) | 转发(0) |