mysql介紹及安裝

來源:互聯網
上載者:User

標籤:cut   開啟   solaris   call   load   data   一個資料庫   optimize   deb   

一、MySQL介紹1、標誌

MySQL的海豚標誌的名字叫“sakila”,它是由MySQL AB的創始人從使用者在“海豚命名”的競賽中建議的大量的名字表中選出的。獲勝的名字是由來自非洲斯威士蘭的開源軟體開發人員Ambrose Twebaze提供。根據Ambrose所說,Sakila來自一種叫SiSwati的斯威士蘭方言,也是在Ambrose的家鄉烏幹達附近的坦桑尼亞的Arusha的一個小鎮的名字。

註:sakila同時也是MySQL內建的一個資料庫範例(sakila sample database)。

2.MySQL發展

MySQL的曆史最早可以追溯到1979年,有一個人叫Monty Widenius, 為一個叫TcX的小公司打工,並用BASIC設計了一個報表工具,可以在4M主頻和16KB記憶體的電腦上運行。過了不久,又將此工具,使用C語言重寫,移植到Unix平台,當時,它只是一個很底層的面向報表的儲存引擎。這個工具叫做Unireg。
1985 年,瑞典的幾位志同道合小夥子(以David Axmark 為首) 成立了一家公司,這就是MySQL AB 的前身。這個公司最初並不是為了開發資料庫產品,而是在實現他們想法的過程中,需要一個資料庫。他們希望能夠使用開源的產品。但在當時並沒有一個合適的選擇,沒辦法,那就自己開發吧。

在最初,他們只是自己設計了一個利用索引順序存取資料的方法,也就是I S A M(Indexed Sequential Access Method)儲存引擎核心演算法的前身,利用ISAM 結合mSQL 來實現他們的應用需求。在早期,他們主要是為瑞典的一些大型零售商提供資料倉儲服務。在系統使用過程中,隨著資料量越來越大,系統複雜度越來越高,ISAM 和mSQL 的組合逐漸不堪重負。在分析效能瓶頸之後,他們發現問題出在mSQL 上面。不得已,他們拋棄了mSQL,重新開發了一套功能類似的資料存放區引擎,這就是ISAM 儲存引擎。大家可能已經注意到他們當時的主要客戶是資料倉儲,應該也容易理解為什麼直至現在,MySQL 最擅長的是查詢效能,而不是交易處理(需要藉助第三方儲存引擎)。

1990年,TcX的customer 中開始有人要求要為它的API提供SQL支援,當時,有人想到了直接使用商用資料庫算了,但是Monty覺得商用資料庫的速度難令人滿意。於是,他直接藉助於mSQL的代碼,將它整合到自己的儲存引擎中。但不巧的是,效果並不太好。於是,Monty雄心大起,決心自己重寫一個SQL支援。

1996年,MySQL 1.0發布, 在小範圍內使用。到了96年10月,MySQL 3.11.1發布了,沒有2.x版本。最開始,只提供了Solaris下的二進位版本。一個月後,Linux版本出現了。 此時的MySQL還非常簡陋,除了在一個表上做一些Insert,Update,Delete和Select 操作職位,沒有其他更多的功能。

緊接下來的兩年裡,MySQL依次移植到各個平台下。它發布時,採用的許可策略,有些與眾不同:允許免費商用,但是不能將MySQL與自己的產品綁定在一起發布。如果想一起發布,就必須使用特殊許可,意味著要花銀子。當然,商業支援也是需要花銀子的。其它的,隨使用者怎麼用都可以。這種特殊許可為MySQL帶來了一些收入,從而為它的持續發展打下了良好的基礎。

1999-2000年,有一家公司在瑞典成立了,叫MySQL AB。 雇了幾個人,與Sleepycat合作,開發出了 Berkeley DB引擎, 因為BDB支援交易處理,所以,MySQL從此開始支援交易處理了。

在2000 年的時候,MySQL 公布了自己的原始碼,並採用GPL(GNU General Public License)許可協議,正式進入開源世界。

2000年4月,MySQL對舊的儲存引擎進行了整理,命名為MyISAM。

2001年,Heikiki Tuuri向MySQL提出建議,希望能整合他們的儲存引擎InnoDB,這個引擎同樣支援交易處理,還支援行級鎖。所以在2001年發布的3.23 版本的時候,該版本已經支援大多數的基本的SQL 操作,而且還整合了MyISAM和InnoDB 儲存引擎。MySQL與InnoDB的正式結合版本是4.0。

2004年10月,發布了經典的4.1版本。 2005年10月,有發布了裡程碑的一個版本,MySQL 5.0. 在5.0中加入了遊標,預存程序,觸發器,視圖和事務的支援。在5.0 之後的版本裡,MySQL明確地表現出邁向高效能資料庫的發展步伐。

2008年1月16號 MySQL被Sun公司收購。

2009年04月20日Oracle收購Sun 公司,MySQL 轉入Oracle 門下。

2010年04月22 發布MySQL 5.5, MySQLcluster 7.1.

Oracle 對MySQL版本重新進行了劃分,分成了社區版和企業版,企業版是需要收費的,當然收費的就會提供更多的功能。

二、MySQL安裝1、windows版本

windows平台:win 7 64位

mysql版本:5.5.27(mysql-5.5.27-win32.msi)

(1)雙擊安裝包,開啟mysql安裝嚮導,點擊next:

(2)打勾許可協議,點擊next:

(3)選擇安裝方式:Custom

Typical 典型安裝。安裝最常見的程式功能,推薦給大多數使用者。
Custom 自訂安裝。允許使用者選擇安裝的程式功能和安裝的位置,建議進階使用者使用。(推薦)
Complete 完整安裝。將安裝所有的程式功能,需要最多的磁碟空間。

 

 

 

 

 (4)選擇功能組件:
MySQL Server     安裝MySQL Server主程式
  Client Programs various helpful(commandline)tools including the mysql command line client 各種有用的(命令列)工具包括MySQL命令列用戶端
  Debug binaries debug/trace versions of executables and libraries 調試/跟蹤可執行檔和庫檔案的版本
Development Components   installs c/c++ header files and libraries 安裝C / C++標頭檔和庫
Debug Symbols   installs Debug Symbols 安裝偵錯符號
Server data files    server data files 伺服器資料檔案
①指定MySQL程式檔案的安裝路徑:選中"MySQL Server"項,點擊"Browser"選擇一個檔案夾

 

②指定MySQL資料檔案的安裝路徑:選中"Server data files"項,點擊"Browser"選擇一個檔案夾

(5)點擊next,進入安裝介面,點擊install,等待安裝完成,然後打勾"launch the mysql instance configuration wizard",點擊"finish",啟動MySQL執行個體設定精靈:

(6)選擇配置類型:

 

Detailed Configuration

詳細配置

choose this configuration type to create the optimal server setup for this machine

選擇此配置類型以建立此機器的最佳伺服器設定.

Standard Configuration

標準配置

use this only on machines that do not already have a mysql server installation.This will use a general purpose configuration for the server that can be tuned manually

該項只適用於沒有安裝過MySQL伺服器的機器。這將使用一個通用的配置的伺服器,可以手動調整。

 

  (7)選擇服務類型:Developer Machine

 

Developer Machine

程式開發伺服器 This is a development machine,and many other applications will be run on it.mysql server should only use a minimal amount of memory. 這是一個開發機,其上運行許多其他應用程式.mysql伺服器應該只使用少量的記憶體。
Server Machine 伺服器機器 several server applications will be running on this machine.Choose this option for web/application servers.mysql will have medium memory usage. 一些伺服器應用程式將運行在本機,選擇該項用於網頁/應用服務.mysql將使用中等記憶體。
Dedicated MySQL Server Machine 專用MySQL伺服器 This machine is dedicated to run the MySQL Datebase.No other servers,such as a web or mail server,will be run.MySQL will utilize up to all available memory. 本機專用於運行MySQL資料庫。沒有其他伺服器,如Web或郵件伺服器,將要運行。mysql將利用所有可用的記憶體。

 

 (8)選擇要使用的資料庫:Multifunctional Database

 

Multifunctional Database 多功能資料庫 General purpose databases.This will optimize the server for the use of the fast transactional InnoDB storage engine and the high speed MyISAM storage engine. 通用的資料庫,這將最佳化使用快速事務儲存引擎InnoDB和高速儲存引擎MyISAM的伺服器。
Transactional Database Only

交易處理資料庫 Optimized for application servers and transactional web applications.This will make InnoDB the main storage engine.Note that the MyISAM engine can still be used. 應用伺服器和事務性Web應用程式進行了最佳化。這將使InnoDB儲存引擎成為主要。需要注意的是MyISAM引擎仍然可以使用。
Non-Transactional Database Only

非交易處理資料庫 Suited for simple web applications,monitoring or logging applications as well as analysis programs.Only the non-transactional MyISAM storage engine will be activated. 適合簡單的Web應用程式,監視或日誌的應用以及剖析器。只有非事務性儲存引擎MyISAM將被啟用。

 

 (9)選擇InnoDB資料庫檔案的儲存位置:

 

(10)設定與伺服器並發串連的近似數目:

 

Decision Support (DSS)/OLAP

決策支援系統(DSS)和OLAP

Select this option for database applications that will not require a high number of concurrent connections.A number of 20 connections will be assumed.

為不需要大量並發串連的資料庫應用程式選擇此選項。將假定20個串連數。

Online Transaction Processing(OLTP)

線上交易處理(OLTP)

Choose this option for highly concurrent application that may have at any one time up to 500 active connections such as heavily loaded web servers.

為高並發應用程式選擇此選項,該應用程式在任何時候都可能有多達500個活動串連,如重載的web伺服器.。

Manual Setting

手動設定

Please enter the approximate number of concurrent

請輸入近似的並發數

 

 (11)設定網路選項:3306連接埠

 

Enable TCP/IP Networking 啟用TCP / IP網路

Enable this to alllow TCP/IP connections.When disabled,only local connections through named pipes are allowed.

Add firewall exceptionfor this port.

啟用此項允許TCP/IP串連。當禁用時,只允許通過具名管道的本地串連。

給這個連接埠添加防火牆例外。

Enable Strict Mode 啟用strict 模式 This option forces the server to behave more like a traditional database server.It is recommended to enable this option. 此選項強制服務器更像傳統的資料庫伺服器。建議啟用此選項。

 

 (12)選擇預設字元集:utf-8

Standard Character Set 標準字元集 Makes Latin1 the default charset.This character set is suited for English and other West European languages. 使用latin1作為預設字元集,這個字元集是適合英語和其他歐洲語言。
Best Support For Multilingualism 多語言最佳支援 Make UTF8 the default character set.This is the recommended character set for storing text in many different languages. 使用UTF8作為預設的字元集,這是在許多不同的語言推薦使用的字元集儲存文本。
Manual Selected Default Character Set /Collation  手動選擇預設字元集/排序 Please specify the character set to use 請指定要使用的字元集

 

 (13) 設定windows選項:

Install As windows Service 作為Windows服務安裝

This is the recommended way to run the MySQL server on Windows.

Launch the MySQL Server automatically

這是推薦的方式對於運行在Windows上的MySQL伺服器。

自動啟動MySQL伺服器

Include Bin Directory in Windows PATH 添加到Windows PATH路徑 Check this option to include the directory containing the server/client executables in the Windows PATH variable so they can be called from the command line. 選中此選項將在Windows PATH變數包含該目錄伺服器/用戶端的可執行檔,所以它們可以從命令列調用。

 

 (14)設定安全選項:設定密碼(不可以為空白)

Modify Security Settings 修改安全設定 Enable root access from remote machines 允許從遠程機器上對根訪問
create an anonymous account 建立一個匿名帳戶 This option will create an anonymous account on this server.Please note that this can lead to an insecure system. 此選項將在該伺服器上建立匿名帳戶。請注意,這可能導致不安全的系統。

 

(15)點擊"execute"開始配置,(期間可能出現1~5分鐘未響應,正常現象)直至安裝完成。

(16)檢測是否安裝成功: ①MySQL內建一個命令列式的登入工具:開始→所有程式→MySQL→MySQL Server 5.5→MySQL 5.5 Command Line Client,開啟,輸入密碼,能夠登入到MySQL說明安裝成功。②用cmd命令列登入:mysql -h localhost -u root -p password

③windows服務中會有名為"MySQL"的服務:

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.