升级phpstudy的mysql版本

1 备份原来的mysql

2 解压下载好的mysql到phpstudy的mysql目录下

下载链接:https://dev.mysql.com/downloads/mysql/5.7.html#downloads

3 复制一份my-default.ini并将其重命名为my.ini

4 打开my.ini,添加

skip-grant-tables
basedir="D:/program/phpstudy2018/PHPTutorial/MySQL/"
datadir="D:/program/phpstudy2018/PHPTutorial/MySQL/data/"

5 打开mysql命令行

mysql >use mysql;

mysql >update user set authentication_string=password('你要的密码') where user='root';

mysql > flush privileges;

6 退出mysql,重新打开my.ini,并将skip-grant-tables注释掉

# skip-grant-tables

 7 重启phpstudy,用密码登录mysql,如果执行命令时出现

You must reset your password using ALTER USER statement before executing this statement.

8 则输入命令(其实就是用户授权)

alter user user() identified by "你的密码";

你可能感兴趣的:(phpstudy)