phpStudy中的mysql升级版本至5.7

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/han_cui/article/details/89251411


步骤:
一、把原来 phpStudy 中 MySQL 安装目录改名
二、把下载的新版 MySQL 压缩文件解压至 phpStudy 下改名为 MySQL目录,复制 my-default.ini ,重命名为 my.ini。
三、打开 my.ini,找到 #basedir 处编辑:
四、在 cmd 下进入 MySQL 的 bin 目录(我的是 D:/phpStudy/MySQL/bin),执行:
如果没有错误启动失败 执行:
五、此时登入 MySQL :
如果无法登陆 修改root密码
修改密码
刷新权限
此时查看 mySQL 版本:
PHP Study无法启动MySQL 执行:
此时PHP StudyMySQL 可以启动了
PHPStudyMySQL升级5.7完整教程含MySQL无法启动解决方式
步骤:
一、把原来 phpStudy 中 MySQL 安装目录改名
二、把下载的新版 MySQL 压缩文件解压至 phpStudy 下改名为 MySQL目录,复制 my-default.ini ,重命名为 my.ini。
三、打开 my.ini,找到 #basedir 处编辑:
basedir=D:/phpStudy/MySQL
1
四、在 cmd 下进入 MySQL 的 bin 目录(我的是 D:/phpStudy/MySQL/bin),执行:
1 切记以管理员身份运行cmd
2 mysqld --initialize    初始化数据库
3 mysqld -install    启动服务:
4 net start MySQL    启动服务

如果没有错误启动失败 执行:
1 sc delete mysql    删除mysql服务    执行后初始化数据库并执行

五、此时登入 MySQL :
1 C:\Users\dell>mysql -uroot -p

如果无法登陆 修改root密码
打开 my.ini,找到 [mysqld],在下面添加:
skip-grant-tables
此时使用 root 账号,密码处按回车即可登录。

修改密码
1 use mysql
2 update mysql.user set authentication_string=password('new_password') where user='root' and Host ='localhost'

刷新权限
1 FLUSH PRIVILEGES;

注释掉 my.ini 中刚才添加的
skip-grant-tables
重新登录。

使用use mysql;报错 
mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
用这个命令
mysql> alter user user() identified by "root" ;
Query OK, 0 rows affected (0.22 sec)

此时查看 mySQL 版本:
mysql> select version();
±----------+
| version() |
±----------+
| 5.7.17 |
±----------+

PHP Study无法启动MySQL 执行:
net stop mysql
sc delete mysql 

此时PHP StudyMySQL 可以启动了
温馨提示: MySQL服务 是MySQL
PHP StudyMySQL服务是MySQLa
--------------------- 
https://blog.csdn.net/qq_42967413/article/details/84849415

https://blog.csdn.net/weixin_36185028/article/details/81632602

https://blog.csdn.net/han_cui/article/details/79254508

https://blog.csdn.net/u010300913/article/details/79193328

mysql5.7下载地址:https://dev.mysql.com/downloads/file/?id=467269

猜你喜欢

转载自blog.csdn.net/han_cui/article/details/89251411