這是歷史版本頁面 — 看 MySQL (64-bit) 最新版本

想學資料庫先裝哪套?MySQL 能幫你做到什麼

MySQL (64-bit) 軟體圖示 MySQL (64-bit) 5.6.16 (64-bit) 資料更新 2014-02-04 閱讀約 6 分鐘

你正在架一個網站、寫一支會存資料的程式,或學校作業要用到資料庫。你上網查「資料庫 軟體」,跑出一堆名字,每個看起來都很專業,但你其實只想知道:裝哪一套可以趕快把資料存進去、把資料撈出來,不要卡在安裝和設定。你怕選錯,更怕裝了之後才發現不適合,又要重來。

很多人第一個念頭是用 Excel 或 Google 試算表硬撐,但資料一多、要同時讓好幾個人查詢、要寫條件篩選的時候,試算表就開始卡。另一條路是直接租雲端資料庫,但每個月要付錢,對還在學習或開發階段的人來說負擔太大。這類資料庫軟體的切入點是:給你一套在本機就能跑的關聯式資料庫,用 SQL 指令跟它溝通,先解決「有地方存資料」這個根本問題。

01MySQL 到底是做什麼用的?

它是一套關聯式資料庫管理系統,用來儲存、管理、查詢資料。你可以把它想成一個放在電腦裡的資料倉庫,透過 SQL 指令建立資料表、寫入資料、下條件查詢。它本身沒有圖形介面,安裝完之後是背景服務,要另外裝管理工具才能看到資料內容。

02我完全沒碰過資料庫,這套軟體適合入門嗎?

適合,但要有心理準備。它主要透過命令列操作,你至少要會基本的 SQL 語法,例如 CREATE TABLE、SELECT、INSERT 這些指令。官方文件寫得很完整,網路上教學資源也很多,只是學習曲線比圖形介面的工具陡一些。如果你完全不想碰指令,可以搭配 MySQL Workbench 這類圖形工具使用。

03它跟 Excel 有什麼差?什麼時候該換成資料庫?

Excel 適合幾千筆以內、單人編輯、不需要複雜關聯的資料。當資料量變大、多人同時讀寫、或你要做跨表格查詢的時候,Excel 會明顯變慢且容易出錯。MySQL 用 SQL 處理查詢,效能穩定,也支援多人同時連線,適合網站、應用程式這類需要頻繁讀寫資料的場景。

04安裝過程會不會很複雜?

安裝本身不複雜,執行安裝檔、按幾個下一步就裝好了。比較需要花時間的是安裝後的設定,包括資料庫帳號密碼、存取權限、連線埠這些。官方文件有提到,安裝時可以設定資料庫選項、定義存取權限、指定儲存方式。如果你只是想先跑起來,用預設值就可以了。

05它有沒有圖形介面可以用?

軟體本身只有命令列介面,但官方文件列出了幾個第三方圖形工具,包括 phpMyAdmin、MySQL Workbench、Navicat。這些工具可以讓你用滑鼠建立資料表、執行查詢、看效能狀態,不用背指令。其中 MySQL Workbench 是 Oracle 出的免費工具,跟 MySQL 搭配使用的人很多。

06我寫程式的語言跟它合得來嗎?

官方文件說它支援多種程式語言,並提供對應的連接器,例如 Java 用 MySQL Connector/J、Python 用 MySQL Connector/Python。也就是說,你只要照官方文件把對應的驅動程式裝好,就可以從程式裡連到資料庫下 SQL 指令。PHP、C# 這些常見語言也都有社群提供的連線方式。

07這套軟體是免費的嗎?

它分成兩個版本:Community Edition 免費且開放原始碼,Enterprise Edition 要訂閱付費。免費版涵蓋大部分日常功能,但官方文件提到,即時分析、企業級技術支援這類進階功能只有在付費版才有。一般學習、開發、小型專案用免費版就夠了。

08我只會 Windows,這套軟體在我的電腦上跑得起來嗎?

可以。官方支援 Windows 7 到 Windows 11 的 64 位元系統,也支援 macOS 和 Linux。安裝時要注意你的系統是 64 位元,硬碟空間和記憶體要看資料庫大小決定,官方文件說需求會依版本和資料量而不同。

09介面是中文的嗎?

不是。軟體本身的介面是英文,安裝過程和命令列操作都是英文。如果你對英文介面不熟悉,操作上會多一層障礙。不過圖形工具 MySQL Workbench 的介面也是英文,這點要先有心理準備。網路上有大量中文教學,可以邊看邊學。

10我只是想存一些個人資料,這套會不會太重?

如果你的需求是單機、單人、資料量不大,SQLite 這類輕量資料庫可能更適合。SQLite 不需要安裝伺服器、不需要設定帳號密碼,把資料庫存成一個檔案就能用。MySQL 需要背景服務持續執行,對純個人用途來說確實比較重,但如果你之後要學網站開發,遲早會用到它。

11我聽說微軟也有免費的 SQL Server Express,跟它比起來呢?

SQL Server Express 是微軟出的免費資料庫,介面是中文的,圖形工具 SSMS 也比較完整,對 Windows 使用者來說上手門檻較低。MySQL 的優勢是跨平台、開源、社群龐大,而且網路上教學資源非常多。兩套都是免費的,你可以先裝 MySQL 試試,不習慣再換 SQL Server Express。

12這套軟體是不是很久沒更新了?

不是。根據收錄的版本紀錄,它從 2011 年至今持續有新版釋出,最近一年內更新了 3 次,最近兩年內更新了 7 次,屬於持續維護中的軟體。開發商是 Oracle,背後有商業公司在維護,不用擔心專案突然停擺。

下載與官方連結

前往官方網站 下載 MySQL (64-bit)

mysql-5.6.16-winx64.msi · 40.81 MB · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

Functionality Added or Changed:
- Previously, ALTER TABLE in MySQL 5.6 could alter a table such that the result had temporal columns in both 5.5 and 5.6 format. Now ALTER TABLE upgrades old temporal columns to 5.6 format for ADD COLUMN, CHANGE COLUMN, MODIFY COLUMN, ADD INDEX, and FORCE operations. This conversion cannot be done using the INPLACE algorithm, so specifying ALGORITHM=INPLACE in these cases results in an error. (Bug #17246318)
- CMake now supports a -DTMPDIR=dir_name option to specify the default tmpdir value. If unspecified, the value defaults to P_tmpdir in . Thanks to Honza Horak for the patch. (Bug #68338, Bug #16316074) Bugs Fixed:
- InnoDB; Replication: Using the InnoDB memcached plugin (see InnoDB Integration with memcached) with innodb_api_enable_binlog set to 1 caused the server to leak memory. (Bug #70757, Bug #17675622)
- InnoDB: A boolean mode full-text search query would result in a memory access violation during parsing. (Bug #17978763)
- InnoDB: When new indexes are added by an ALTER TABLE operation, instead of only saving table-level statistics and statistics for the new indexes, InnoDB would save statistics for the entire table, including the table's other indexes. This behavior slowed ALTER TABLE performance. (Bug #17848838, Bug #16511145)
- InnoDB: Due to a parser error, full-text search queries that include a sub-expression could return the wrong result. (Bug #17840768)
- InnoDB: The innochecksum tool did not use a Windows-specific API to retrieve file size information, which resulted in an incorrect error message (Error: ibdata1 cannot be found) when the MySQL 5.6 innochecksum 2GB file size limit was exceeded. innochecksum now provides support for files larger than 2GB in both MySQL 5.6 and MySQL 5.7. (Bug #17810862, Bug #70936)
- InnoDB: Due to a regression introduced by the fix for Bug#17371537, memory was not allocated for the default memcached engine when using the default memcached engine as the backstore for data instead of InnoDB. (Bug #17800829)
- InnoDB: InnoDB would report an incorrect operating system error code after failing to initialize. (Bug #17788055, Bug #70867)
- InnoDB: Manipulating a table after discarding its tablespace using ALTER TABLE ... DISCARD TABLESPACE could result in a serious error. (Bug #17700280)
- InnoDB: Persistent optimizer statistics would cause stalls due to latch contention. (Bug #17699331, Bug #70768)
- InnoDB: MATCH() ... AGAINST queries that use a long string as an argument for AGAINST() could result in an error when run on an InnoDB table with a full-text search index. (Bug #17640261)
- InnoDB: An InnoDB full-text search failure would occur due to an “unended” token. The string and string length should be passed for string comparison. (Bug #17659310)
- InnoDB: In debug builds, a merge insert buffer during a page read would cause a memory access violation. (Bug #17561188)
- InnoDB: Truncating a memcached InnoDB table while memcached is performing DML operations would result in a serious error. (Bug #17468031)
- InnoDB: In sync0rw.ic, rw_lock_x_lock_func_nowait would needlessly call os_thread_get_curr_id. (Bug #17509710, Bug #70417)
- InnoDB: Attempting to rename a table to a missing database would result in a serious error. (Bug #17447500)
- InnoDB: If a tablespace data file path is updated in a .isl file and then a crash recovery is performed, the updated tablespace data file path is read from the .isl file but the SYS_DATAFILES table would not be not updated. The SYS_DATAFILES table is now updated with the new data file path after crash recovery. (Bug #17448389)
- InnoDB: If the first page (page 0) of file-per-table tablespace data file was corrupt, recovery would be halted even though the doublewrite buffer contained a clean copy of the page. (Bug #17335427, Bug #70087)
- InnoDB: The InnoDB memcached Readme file (README-innodb_memcached) incorrectly stated that libevent 1.6.0 is linked statically into daemon memcached. The bundled version of libevent is 1.4.12, not 1.6.0. (Bug #17324419, Bug #70034)
- InnoDB: Attempting to reset a replication slave while innodb_force_recovery is greater than 0 would return a cryptic error message: ERROR(1030) HY000: Got error -1 from storage engine. The error message has been changed to: ERROR HY000: Operation not allowed when innodb_force_recovery > 0. Replication options such as --relay-log-info-repository=TABLE and --master-info-repository=TABLE store information in tables in InnoDB. When innodb_force_recovery is greater than 0, replication tables cannot be updated which may cause replication administration commands to fail. (Bug #17287443, Bug #69907)
- InnoDB: The ALTER TABLE INPLACE algorithm would fail to decrease the auto-increment value. (Bug #17250787, Bug #69882)
- InnoDB: Comments in btr0cur.cc incorrectly stated that btr_cur_pessimistic_update() and btr_cur_optimistic_update() would accept a NULL value. (Bug #17231743, Bug #69847)
- InnoDB: dict_table_schema_check would call dtype_sql_name needlessly. (Bug #17193801, Bug #69802)
- InnoDB: The function os_file_get_status would not work with raw devices. (Bug #17023438, Bug #69424)
- InnoDB: During crash recovery, an incorrect transaction active time would result in rolling back an uncommitted transaction. (Bug #16936961, Bug #69438)
- InnoDB: Heap block debugging information (file_name, lineno), used for logging diagnostics, would appear in release builds. This information should only appear in debug builds. (Bug #16924719, Bug #69422)
- InnoDB: Renaming a column while also adding or dropping columns in the same ALTER TABLE operation would cause an error. (Bug #16864981)
- InnoDB: An online ALTER TABLE operation would consume more memory than expected. During an online ALTER TABLE operation, an online log buffer containing a head and tail buffer is created for each index that is created or rebuilt. The tail buffer is the writer context and is only required for concurrent write operations on an index while the ALTER TABLE operation is in progress. The head buffer is the reader context and is only required during the log apply phase. To reduce memory consumption, the tail buffer is now allocated when the first DML statement is run on the index, and the head buffer is only allocated in the log apply phase and freed afterwards. (Bug #16868967, Bug #69325, Bug #17911720)
InnoDB: On Windows, the full-text search (FTS) object ID was not in the expected hexadecimal format. (Bug #16559254)
References: See also Bug #16559119.
InnoDB: Fetching and releasing pages from the buffer pool and tracking the page state are expensive and complex operations. Prior to the bug fix, these operations were performed using a page mutex. Using a page mutex to track several things is expensive and does not scale well. The bug fix separates fetch and release tracking (in-use state) of a page from page I/O state tracking. Fetch and release is now tracked using atomics where available.
For portability, a new CMake build option, INNODB_PAGE_ATOMIC_REF_COUNT (default ON), can be used to disable atomic page reference counting on platforms where atomics support is not available. When atomic page reference counting is enabled (default), “[Note] InnoDB: Using atomics to ref count buffer pool pages” is printed to the error log at server startup. If atomic page reference counting is disabled, “[Note] InnoDB: Using mutexes to ref count buffer pool pages” is printed instead. (Bug #16249481, Bug #68079)
- InnoDB: Table renaming errors would appear in the LATEST FOREIGN KEY ERROR section of the SHOW ENGINE INNODB STATUS output. (Bug #12762390, Bug #61746)
- InnoDB: UNIV_SYNC_DEBUG, which was disabled in univ.i with the fix for Bug#16720368, is now enabled. (Bug #69617, Bug #17033591)
- Partitioning: Queries using the index_merge optimization (see Index Merge Optimization) could return invalid results when run against tables that were partitioned by HASH. (Bug #17588348, Bug #70588)
- Partitioning: When no partition had returned a row since the last HA_ERR_KEY_NOT_FOUND error, the use of uninitialized memory in the priority queue used for returning rows in sorted order could lead to a crash of the server. (Bug #17401628)
- Replication: When the binary log I/O cache grew to exactly 32768 bytes and the current transaction was preceded by a transaction whose size was greater than 32768 bytes, events could be corrupted when written into the binary log. (Bug #17842137)
- Replication: Creating and dropping large numbers of temporary tables could lead to increased memory consumption. (Bug #17806014)
- Replication: mysqlbinlog --verbose failed when it encountered a corrupt row event in the binary log. Such a row event could also cause the slave to fail. (Bug #17632978)
- References: See also Bug #16960133.
- Replication: When log_warnings is greater than 1, the master prints binary log dump thread information—containing the slave server ID, binary log file name, and binary log position—in mysqld.1.err. A slave server ID greater than 2 billion was printed with a negative value in such cases. (Bug #17641586, Bug #70685)
- Replication: mysqlbinlog did not properly decode DECIMAL values in a row-based binary log. This could cause invalid values to be printed out for DECIMAL columns. (Bug #17544169)
- References: See also Bug #14309019.
- Replication: Seconds_Behind_Master in the output of SHOW SLAVE STATUS could under some conditions be reported as 0 when it should have had a value greater than zero. (Bug #17233214)
- References: See also Bug #16579028.
- Replication: The semisynchronous replication plugin was called twice for a DDL statement, incrementing Rpl_semi_sync_master_yes_tx by 2 instead of 1 each time such a statement was executed. (Bug #70410, Bug #17509011)
- Compilation errors occurred on Solaris 10; resolved by including my_config.h before system header files. (Bug #18046811)
- FORCE INDEX [FOR ORDER BY] (index_name) did not work for joins.
- The fix for this bug also also changes the warning created for EXPLAIN. Instead of printing only {IGNORE|USE|FORCE} INDEX it now also prints FOR {GROUP BY|ORDER BY|JOIN} if that was specified in the query. (Bug #17889511)
- With the compressed client/server protocol enabled, Performance Schema statement instrumentation could raise an assertion. (Bug #17794846)
- In some cases, UNIX_TIMESTAMP() could return NULL when it should return 0. (Bug #17728371)
- An assertion could be raised if a filesort failed to resize its main buffer when record properties changed. (Bug #17757914)
- The cache used for the Index Merge access method was freed only after successful retrieval of all rows. Interruption or failure of the operation led to a file descriptor leak. (Bug #17708621)
- Using the mysqldump --set-gtid-purged option with no value caused mysqldump to crash. (Bug #17650245)
- A race condition between Performance Schema statement event threads led to a server exit. (Bug #17637970)
- In a view definition requireing resolution of aggregrate expressions within a subquery to an outer query, selecting from the view could cause a server exit. (Bug #17547804)
- References: This bug is a regression of Bug #16436383.
- An addressing error in accessing the join buffer could produce invalid results or a server exit. (Bug #17513341)
- mysql_config incorrectly included some flags to generate compiler warning output. (Bug #17400967)
- With semi-join optimization enabled, queries with nested subqueries could cause a server exit due to incorrect resolution of references to columns in the middle query block. (Bug #17398972)
- In some cases, the optimizer wrote fixed-length temporary MyISAM tables to disk rather than variable-length temporary tables. (Bug #17231940)
- Enabling the validate_password plugin could result in incorrect password hashes being stored in the mysql.user table. (Bug #17065383)
- For accounts authenticated using the sha256_password plugin, setting the password after the password had been expired did not clear the password-expired flag. (Bug #16872181)
- On Mac OS X 10.7, a race condition involving vio_shutdown() and the select-based implementation of vio_io_wait() could cause a server exit. (Bug #16354789, Bug #17733393)
- Host names in example URLs used within the source code were replaced by names in the example.com domain, the domain intended by IANA for this purpose. (Bug #15890092)
- For utf8 and utf8mb4 strings, handler functions unnecessarily called a Unicode conversion function. (Bug #14057034)
- Several -W warning flags were turned off for compilation in maintainer mode if MySQL was configured with -DWITH_INNODB_MEMCACHED=1. (Bug #13898319)
- Calling the ExtractValue() function with an invalid XPath expression could in some cases lead to a failure of the server. (Bug #12428404, Bug #61065)
- Use of a nonmulti-byte algorithm for skipping leading spaces in multi-byte strings could cause a server exit. (Bug #12368495)
- With ONLY_FULL_GROUP_BY SQL mode enabled, a query that uses GROUP BY on a column derived from a subquery in the FROM clause failed with a column isn't in GROUP BY error, if the query was in a view. (Bug #11923239)
- For the utf8_bin collation, ORDER BY LOWER(col_name) could produce incorrect ordering. (Bug #69005, Bug #16691598)
- Several issues identified by the Coverity static analysis tool were fixed. Thanks to Honza Horak for the patch. (Bug #70830, Bug #17760511)
- On Windows, the --local-service server option did not work, and was not displayed in the --help message. (Bug #69637, Bug #17049656)
- It was not possible to query a view with an ORDER BY clause that referenced an alias in the SELECT clause of the view definition, unless all columns in the view were named in the select list.
- To handle this problem, the server now writes a view differently into the .frm file that stores the view definition. If you experience view-evaluation errors such as just described, drop and recreate the view so that the .frm file contains the updated view representation. (Bug #69678, Bug #17077305)
- The prototype of the Performance Schema instrumentation API mysql_cond_timedwait() call was fixed to be drop-in compatible with pthread_cond_timedwait(). This fix affects only implementers of third-party plugins. (Bug #70628, Bug #17702677)
- The make_atomic_cas_body64 implementation on IA32 with gcc but without gcc builtins could be miscompiled due to an incorrect constraint. The patch also causes MySQL to use builtin atomics when compiled using Clang. (Bug #63451, Bug #17242996)
- Complex updates of Performance Schema tables involving joins or subqueries failed to update every row. (Bug #70025, Bug #17309657)
For the path specified with the --basedir option, mysql_plugin attempted to unlink the path rather than free the memory in which the path was stored. (Bug #69752, Bug #17168602)
- COUNT(DISTINCT) sometimes produced an incorrect result when the last read row contained a NULL value. (Bug #68749, Bug #16539979, Bug #71028, Bug #17867117)
- sql_resolver.cc referred to partitioning code that should have been protected by an #ifdef, even when MySQL was configured with -DWITH_PARTITION_STORAGE_ENGINE=OFF. (Bug #71010, Bug #17876794)
- In incorrect result could be returned for a query with an IF() predicate in the WHERE clause combined with OUTER JOIN in a subquery that is transformed to a semi-join. (A workaround is to disable semi-join using SET optimizer_switch='semijoin=off';) (Bug #70608, Bug #17600176)
- A full-text search combined with derived tables (subqueries in the FROM clause) caused a server exit.
- Now if a full-text operation depends on a derived table, the server produces an error indicating that a full-text search cannot be done on a materialized table. (Bug #68751, Bug #16539903)
- Some scripts displayed out-of-date information regarding where to report bugs. (Bug #68742, Bug #16530527)
- Some files in the Performance Schema file_instances table were not being removed because the file-removal operation was not instrumented. (Bug #69782, Bug #17209750)
- mysqldump --single-transaction acquired metadata locks for each dumped table but did not release them until the dump operation finished. Consequently, other DDL operations on a dumped table blocked even after the table itself had been dumped. mysqldump now attempts to release metadata locks earlier. (Bug #71017, Bug #17862905)
- Updating a FEDERATED table with UPDATE... JOIN caused a server exit when the local table contained a single row and that row could be joined to a row in the FEDERATED table. (Bug #68354, Bug #16324629)
- mysql_install_db referred to the obsolete mysqlbug script for reporting problems. It now refers to http://bugs.mysql.com/ instead. (Bug #29716, Bug #11746921)