標籤:style blog http color 使用 os io 資料
1.首先到http://dev.mysql.com/ 上下載windows版mysql5.6免安裝zip包。然後將zip包解壓到D:\mysql-5.6.20-winx64下。
2.複製mysql下的my-default.ini, 在同目錄下建立my.ini. my.ini為mysql的配置。最簡單的配置:
1 basedir=D:/mysql-5.6.20-winx642 datadir=D:/mysql-5.6.20-winx64/data
base config
我的配置為:
1 # For advice on how to change settings please see 2 # http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html 3 # *** DO NOT EDIT THIS FILE. It‘s a template which will be copied to the 4 # *** default location during install, and will be replaced if you 5 # *** upgrade to a newer version of MySQL. 6 7 [mysqld] 8 character-set-server=utf8 9 10 # Remove leading # and set to the amount of RAM for the most important data11 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.12 # innodb_buffer_pool_size = 128M13 14 # Remove leading # to turn on a very important data integrity option: logging15 # changes to the binary log between backups.16 # log_bin17 18 # These are commonly set, remove the # and set as required.19 # basedir = .....20 # datadir = .....21 # port = .....22 # server_id = .....23 basedir=D:/mysql-5.6.20-winx6424 datadir=D:/mysql-5.6.20-winx64/data25 port=330626 27 character-set-server=utf828 default-storage-engine=INNODB29 innodb_data_home_dir=D:/mysql-5.6.20-winx64/data30 innodb_data_file_path=ibdata1:12M:autoextend31 innodb_log_group_home_dir=D:/mysql-5.6.20-winx64/data32 33 innodb_buffer_pool_size=512M34 # Remove leading # to set options mainly useful for reporting servers.35 # The server defaults are faster for transactions and fast SELECTs.36 # Adjust sizes as needed, experiment to find the optimal values.37 # join_buffer_size = 128M38 # sort_buffer_size = 2M39 # read_rnd_buffer_size = 2M 40 41 # sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
my.ini
3.設定環境變數PATH。將D:\mysql-5.6.20-winx64\bin加入path中。
4.CMD下面嘗試啟動mysqld,並將後台log輸出在螢幕。
5.註冊mysql為windows service. 以後可以使用windows service來安裝mysqld和卸載mysqld的服務.
6.進入服務管理員
7.啟動MySQL服務
8.net start mysql 啟動mysql服務,net stop mysql 停止mysql服務
9.也可以使用mysqladmin命令關閉mysql服務。
10.使用root使用者登入mysql資料庫
11.show databases;顯示所有資料庫
12.修改root帳戶的登陸密碼1234:
13.建立資料庫需要指定中文編碼方式
還有一些測試mysql安裝的命令: