phpStudy的MySQL版本升级方法

phpStudy的MySQL版本升级方法

  • 使用之前的必要准备(phpStudy,MySQL)

使用之前的必要准备(phpStudy,MySQL)

  • 链接:https://share.weiyun.com/52Ao3GU 密码:Delong

phpstudy里没有地方可以设置mysql数据库,很多人都疑惑在phpstudy里怎么升级mysql数据库版本,本文就教你如何在phpstudy中升级mysql的版本。
PhpStudy集成环境中的mysql数据库的版本默认是mysql5.5,下面是PhpStudy升级数据库到mysql5.7的方法:
1:备份当前数据库数据,可以导出数据库文件,作为备份。
2:备份 PhpStudy 下的 MySQL 文件夹、以防升级失败、还可以使用旧版本的数据库
3:下载MySQL5.7、解压、然后放在 PhpStudy 下的 MySQL 文件夹下。地址:https://dev.mysql.com/downloads/file/?id=467269
4:复制一份my-default.ini,改名为my.ini、打开my.ini加上:
basedir=“D:/Software/phpStudy/phpStudy/PHPTutorial/MySQL/”
datadir=“D:/Software/phpStudy/phpStudy/PHPTutorial/MySQL/”
这两项,这两个地址都改成自己对应的phpstudy里的mysql目录和数据库目录。
5:然后以管理员的身份运行cmd、进入MySQL目录、如图所示表示成功、执行如下:
D:\Software\phpStudy\phpStudy\PHPTutorial\MySQL\bin>mysqld --initialize
> mysqld --initialize
> mysqld -install
6:重新启动 phpstudy即可。
注:
遇到这个问题:Unknown column ‘password_last_changed’ in ‘mysql.user’:
修改一下mysql数据的user表结构可以解决问题:

ALTER TABLE `user` ADD `password_expired` ENUM('N','Y') NOT NULL DEFAULT 'N' AFTER `authentication_string`;

你可能感兴趣的:(DataBase)