1、數(shù)據(jù)庫下載
Mysql官方網(wǎng)站:http://www.mysql.com/,數(shù)據(jù)庫下載地址:http://www.mysql.com/downloads/。從官方網(wǎng)站可以找到兩種文件包,一種是exe安裝程序,另一種是zip壓縮包。本人喜歡清爽的方式,所以下載的是ZIP壓縮包。最新的5.6.22大概350M,下載還需要oracle帳號(hào),自己注冊(cè)一個(gè)好了。
2、數(shù)據(jù)庫安裝
解壓出下載的文件mysql-5.6.22-win32.zip(有x86和x64兩個(gè)版本)到任一目錄,防止出現(xiàn)未知問題,最好放在非系統(tǒng)盤的非中文目錄下,我的位置C:/Program Files/mysql-5.6.22-win32。打開文件夾復(fù)制一份my-default.ini為my.ini的配置文件。

打開my.ini文件,相關(guān)配置修改如下
| # For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.6/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.#mysql根目錄 basedir ="C:/Program Files/mysql-5.6.22-win32"#數(shù)據(jù)文件存放目錄 datadir ="C:/Program Files/mysql-5.6.22-win32/data"# port = ..... 端口,默認(rèn)3306# server_id = ..... 服務(wù)實(shí)例的唯一標(biāo)識(shí)# 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 #服務(wù)端的編碼方式character-set-server=utf8[client]#客戶端編碼方式,最好和服務(wù)端保存一致loose-default-character-set = utf8[WinMySQLadmin] Server = "C:/Program Files/mysql-5.6.22-win32/bin/mysqld.exe" |
如果需要更優(yōu)化的my.ini配置文件可以參考這篇文章://m.survivalescaperooms.com/article/84357.htm
上面設(shè)置為了保證服務(wù)正常運(yùn)行,根據(jù)自己需要調(diào)整參數(shù),修改后要重啟服務(wù)。
3、注冊(cè)Mysql服務(wù)
開始——運(yùn)行——cmd,然后cd到mysql安裝目錄的bin下面,我的目錄就是“C:/Program Files/mysql-5.6.22-win32/bin”,然后執(zhí)行mysqld -install,提示服務(wù)安裝成功!運(yùn)行services.msc一看,確實(shí)有一個(gè)名為MySQL的服務(wù)了,啟動(dòng)它。有時(shí)啟動(dòng)失敗,根據(jù)情況調(diào)整參數(shù)即可。
到這兒mysql安裝就算完成了,其實(shí)還挺簡單的,但如果沒有操作過,整個(gè)過程估計(jì)要花不少時(shí)間,也是成長必須的過程。
新聞熱點(diǎn)
疑難解答
圖片精選