Windows下面安裝和配置MySQL(5.6.20)

來源:互聯網
上載者:User

標籤: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安裝的命令:

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.