升級phpStudy中的MySQL

1.下載MySQL最新壓縮版. php

網址以下: https://dev.mysql.com/downloads/mysql/ ,拉到頁面最底部,根據須要,選擇你須要的組合,就能夠拿到最新版的win下面的64位mysql壓縮版了。mysql

2. 備份當前MySQL. sql

  • 中止phpStudy的服務
  • 退出phpStudy
  • 重命名phpStudy下的MySQL文件夾爲MySQL.old便可,默認位置爲C:\phpStudy\PHPTutorial\MySQL

3. 解壓縮最新版mysql
把下載的mysql壓縮版,解壓到phpstudy下面的mysql目錄,默認位置爲C:\phpStudy\PHPTutorial\MySQL。
4. 添加MySQL路徑到環境變量
5. 配置my.ini
6. 添加skip-grant-tables到my.ini的mysqld,省略密碼登錄
7. 啓動MySQLide

  • 使用管理員身份啓動cmd, 輸入net start mysql啓動MySQL
  • mysql -uroot 鏈接到MySQL

8. 在MySQL下運行下列命令ui

use mysql; # use mysql table
update user set authentication_string=PASSWORD("root") where User='root'; # update password to root
update user set plugin="mysql_native_password" where User='root'; # set password resolving to default mechanism for root user

flush privileges;
quit;

9. 在my.ini中註釋掉skip-grant-tables,重啓mysql服務
10. 從新鏈接MySQL,用root/root登錄code

相關文章
相關標籤/搜索