先掛資源,下載地址: http://download.softagency.net/MySQL/Downloads/。
找到MYSQL5.6,兩個版本看系統而定我下的是64位的:http://download.softagency.net/MySQL/Downloads/MySQL-5.6/mysql-5.6.16-winx64.zip。解壓放入自己需要存入的地方,我的路徑是D:\SDT\mysql5.6.16_x64,如下圖所示:
解壓後目錄裡面的文件可能會和圖片裡有點不一樣,沒有my.ini和my_default_old.ini這個兩個文件,並且有一個my_default.ini文件。這是接下來要弄的,把my_default.ini文件在當前文件夾下復制粘貼一份,並把其它一個文件名改成my.ini,另一個可以不管或改成我上面樣子。
my.ini的配置文件需要改兩處理地方:
basedir = D:\\SDT\\mysql5.6.16_x64
datadir = D:\\SDT\\mysql5.6.16_x64\\data
port = 3306
#自定義主機ID識別符,用於主從或多服務器之間識別,為 一個 int 類型
server_id = 1
或
basedir = D:/SDT/mysql5.6.16_x64
datadir = D:/SDT/mysql5.6.16_x64/data
port = 3306
#自定義主機ID識別符,用於主從或多服務器之間識別,為 一個 int 類型
server_id = 1
這裡需要注意的就是,任意一種都行,其它可改可不改,我的完整配置如下:
# 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. basedir = D:\\SDT\\mysql5.6.16_x64 datadir = D:\\SDT\\mysql5.6.16_x64\\data port = 3306 #自定義主機ID識別符,用於主從或多服務器之間識別,為 一個 int 類型 server_id = 1 character_set_server=utf8 # 最大連接數量 max_connections = 100 #CREATE TABLE 語句的默認表類型,如果不自己指定類型,則使用下行的類型 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
接下來是在環境變量”path“裡加入數據庫根目錄路徑,如我的就是"D:\SDT\mysql5.6.16_x64\bin"。
打開cmd控制台,win7系統要以管理員權限打開,輸入"D:\SDT\mysql5.6.16_x64\bin\mysqld.exe --install mysql5",一定要以全路徑
mysql -u root -p",因為數據庫默認root是沒有密碼的,所以直接回車兩下就可以下,接下來輸入"update
user
set
password
=
PASSWORD
(‘’)
where
User
=
'root'
;
"其中"123456"是為要更新的密碼,更據實際改下就行了。
http://cdn.mysql.com/Downloads/MySQLInstaller/mysql-installer-community-5.6.16.0.msi,這個就不說了,看著點就可以了。
再來一個web版在線安裝版: