下載安裝mysql5.7
0X01 打開地址 https://dev.mysql.com/downloads/mysql/ 點擊 Looking for the latest GA version? 按鈕
0X02 點擊下邊的跳過登陸直接下載
0X03 修改PHP工具箱對應目錄下的mysql文件夾名稱 (提前停止mysql服務)
0X04 解壓下載好的mysql5.7到PHP目錄下,並且修改文件夾名稱為MySQL。
0X05 通過cmd進入Mysql目錄
0X06 新建my.ini文件 內容如下 注意替換你得PHP工具箱的目錄
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = "D:/php/myphp_www/PHPTutorial/MySQL/"
datadir = "D:/php/myphp_www/PHPTutorial/MySQL/data/"
port = 3306
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
default-storage-engine=INNODB
0X07 回到CMD窗口,執行命令。
0X08 提示安裝拒絕,這時使用管理員身份運行命令窗口。再從新執行install命令
0X09 此時mysql5.7已經安裝成功,使用net start mysql 嘗試啟動服務(管理員模式下能夠正常啟動,普通權限無法啟動)
0X0A 嘗試再php工具箱中啟動或停止mysql服務(此時PHP工具箱無法啟動mysql服務。)
0X0B 在管理員模式下執行
0X0C 回到PHP工具箱 點擊重啟,此時mysql服務能夠正確的被啟動。
數據恢復
0X01 回到之前的MySQL_BAK目錄下賦值data中的內容到新的MySQL的目錄下,同戶名文件選擇跳過覆蓋。
0X02 通過MYSQL管理工具登陸MYSQL
賬號密碼均為root,此時回1045無法登陸
0X03 由於MYSQL安裝過程中密碼是水機產生,所以我們需要通過日志來查看密碼。
打開MYSQL/data目錄下的.err文件 查找並復制密碼,使用此密碼登陸mysql,並修改設置為自己的密碼。