1、下載mysql-5.7.17-winx64.zip安裝包(鏈接:https://dev.mysql.com/downloads/mysql/)
2、解壓安裝包。
D:\DevelopTool\mysql-5.7.17-winx64 #解壓目錄
3、在解壓目錄下創建一個名為data的文件夾,用來存放數據
D:\DevelopTool\mysql-5.7.17-winx64\data
4、配置啟動文件
把 D:\DevelopTool\mysql-5.7.17-winx64\my-default.ini 文件copy一份,重新命名為 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. [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 = ..... # datadir = ..... # port = ..... # server_id = ..... ######################### # basedir 為安裝文件解壓後的目錄 | basedir和datadir 可以使用相對路徑 # basedir=./.. basedir=D:\\DevelopTool\\mysql-5.7.11-winx64 # datadir 為用來存放數據的目錄 # datadir=./../data datadir=D:\\DevelopTool\\mysql-5.7.11-winx64\\data # port 為端口號 port=3306 # mar_connections為最大連接數 max_connections=20 character_set_server=utf8 # 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 explicit_defaults_for_timestamp=true sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
5、初始化數據目錄
mysqld --defaults-file="D:\DevelopTool\mysql-5.7.17-winx64\my.ini" --initialize-insecure
它會初始化 data 目錄,在執行此命令前請先把data目錄下的所有文件先刪除,否則會失敗
可以選擇用 --initialize-insecure 或者 --initialize 來初始化,--initialize-insecure 初始化root密碼為空,如果用 --initialize來初始化,會產生一個隨機密碼
執行成功後,在data目錄下會生成mysql,perofrmance_schema,sys等目錄文件
6、安裝和啟動mysql服務
#安裝服務 mysqld -install #啟動服務 net start mysql #進入mysql mysql -u root -p #移除mysql mysqld -remove
關於本站給大家提供的mysql專題大家可以參考下:
Mysql在各個系統的安裝教程
Mysql Root密碼操作技巧
MySql數據庫入門教程
MySQL中的數據庫操作知識匯總
以上所述是小編給大家介紹的MySql 5.7.17免安裝配置教程詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對網站的支持!