標籤:
1. 從官網下載安裝包:mysql-5.7.12-win32.zip
2. 解壓到C盤(任意盤符都行)
C:\mysql-5.7.12-win32
3. 修改設定檔:C:\mysql-5.7.12-win32\my-default.ini
# 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 = "C:\mysql-5.7.12-win32" datadir = "C:\mysql-5.7.12-win32\data2016" 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
4. 配置系統內容變數path=....(之前的加上)....;C:\mysql-5.7.12-win32\bin
5. 執行如下命令:
> mysqld --initialize-insecure> mysql -install> net start mysql (或者 net start MySQL)
(如果要重新install,需要先remove:mysql --remove)
6. 如果正常的話,會顯示如下資訊:
C:\mysql-5.7.12-win32\bin>net start MySQLMySQL 服務正在啟動 .MySQL 服務已經啟動成功。
如果啟動報錯,可以看一下mysql的報錯日誌:C:\mysql-5.7.12-win32\data2016\HEJT6VWINGVD59M.err
新安裝的MySQL的root使用者的密碼是空的,所以可以直接連接:mysql -u root -p
MySQL綠色版安裝(mysql-5.7.12-win32)