1.解壓MySQL綠色版,複製my-default.ini,修更名稱爲my.ini 2. 如下爲my.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. [mysql] # 設置mysql客戶端默認字符集 default-character-set=utf8 [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. # 設置mysql的安裝目錄 basedir=D:\MySQL\mysql-5.7.17-winx64 # 設置mysql數據庫的數據的存放目錄 datadir=D:\MySQL\mysql-5.7.17-winx64\data # 設置3306端口 port = 3306 # server_id = ..... # 容許最大鏈接數 max_connections=200 # 服務端使用的字符集默認爲8比特編碼的latin1字符集 character-set-server=utf8 # 建立新表時將使用的默認存儲引擎 default-storage-engine=INNODB # 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 # 安裝教程分3步(切記以管理員模式運行cmd)# 1.初始化 mysqld --initialize# 2.mysqld -install MySQL --defaults-file="D:\MySQL\mysql-5.7.17-winx64\my.ini# 3.登陸MySQL後修改密碼:set password for root@localhost = password('root');# 4.刷新:flush privileges;