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

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

MySQL (64-bit) 軟體圖示 MySQL (64-bit) 5.7.19 (64-bit) 資料更新 2017-07-18 閱讀約 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.7.19-winx64.msi · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

Functionality Added or Changed:
- Replication: View change events from a Group Replication group can now be replicated to an external multithreaded slave (MTS) of type DATABASE
- Replication: When a negative or fractional timeout parameter was supplied to WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(), the server behaved in unexpected ways
- If MySQL was configured to build with the -Wno-error option, mysql_config produced incorrect output for its --cflags option. The set of compiler options that mysql_config and pkg-config produce now is determined by whitelisting rather than
- The performance of UTF-8 binary collations was improved
- Consistency and maintainability of Debian/Ubuntu packaging maintainer scripts was improved
- mysql_secure_installation is more strict about what it considers valid yes and no responses
- The replace utility is deprecated and will be removed in MySQL 8.0. If you wish to continue using this utility, be sure to retain a copy from an installed version of MySQL

Bugs Fixed:
- InnoDB: The restriction that required the first undo tablespace to use space ID 1 was removed. The first undo tablespace may now be assigned a space ID other than 1. Space ID values for undo tablespaces are still assigned in a consecutive sequence
- InnoDB: A DROP TABLE operation raised an assertion on a server with an innodb_force_recovery setting of 5 or 6. DROP TABLE is no longer permitted with these innodb_force_recovery settings
- InnoDB: Compiling the server without the Performance Schema caused a build failure
- InnoDB: During read-ahead, the wrong page size was used to calculate the tablespace size
- InnoDB: Compiling on Fedora 25 using DWITH_LZ4=system resulted in a build failure due to a deprecated LZ4_COMPRESS_LIMITEDOUTPUT function
- InnoDB: Disabling macros such as UNIV_PFS_MUTEX, UNIV_PFS_RWLOCK, and UNIV_PFS_THREAD caused compilation errors
- InnoDB: A NULL virtual column field name in a virtual index caused a server exit during a field name comparison that occurs while populating virtual columns affected by a foreign key constraint
- InnoDB: The file handle type name for InnoDB file I/O Performance Schema instrumentation was changed from os_pfs_file_t to pfs_os_file_t
- InnoDB: During a range comparison, a secondary index field number was passed instead of clustered index field number, eventually causing the retrieval of an incorrect field
- InnoDB: A server exit on restart was caused by missing my_thread_init() and my_thread_exit() functions for background threads that initialize the st_my_thread_var structure
- InnoDB: A memcached read operation with a non-default read batch size configuration resulted in a server exit
- InnoDB: A gap lock was taken unnecessarily during foreign key validation while using the READ COMMITTED isolation level
- InnoDB: After a TRUNCATE TABLE operation on a table with a FULLTEXT index, space size was incorrectly calculated resulting in an invalid read
- InnoDB: During a checkpoint, all MLOG_FILE_NAME redo log records were written in a single mini-transaction (mtr), causing a log parsing buffer overflow
- InnoDB: A mechanism was added to debug builds to ensure that keys for InnoDB Performance Schema instrumentation are registered with Performance Schema. The mechanism causes startup to fail on debug builds if the number of Performance Schema keys does not match the number of registered Performance Schema keys
- InnoDB: A race condition while updating table statistics could result in an estimated row count of 1 and an incorrect query execution plan
- InnoDB: An error in code related to table statistics raised an assertion in the dict0stats.cc source file
- InnoDB: A concurrent DML operation during an in in-place ALTER TABLE operation that rebuilt the table did not update a virtual index, resulting in a mismatch between the virtual index and clustered index
- InnoDB: A TRUNCATE TABLE operation held the dict_sys mutex while scanning for and removing pages from the buffer pool, causing concurrent DDL operations to stall. The mutex is now released during the scan and acquired again when the scan is completed
- InnoDB: SELECT COUNT(*) performance regressed in some cases due to a modification introduced in MySQL 5.7.2 that caused InnoDB to count rows by traversing the clustered index instead of a smaller secondary index. The modification was reverted
- InnoDB: Inserting GIS data into an r-tree raised an assertion due to a missing page number field that was encountered when storing the b-tree cursor
- InnoDB: Performance Schema instrumentation for InnoDB file I/O was disabled on Windows
- InnoDB: The row_search_mvcc() function unnecessarily traversed the entire table for a range query, which occurred when the record was not in the transaction read view
- Partitioning: Updating a row of a table that had partitioning on a generated column could raise an assertion failure for debug builds, and return incorrect results in nondebug builds
- Replication: MEMBER_STATE of a group replication member did not go from ERROR to OFFLINE when the STOP GROUP_REPLICATION command was executed if the error state was due to ER3092
- Replication: With flow control enabled, reaching a minimum flow control quota of 1 will made Group Replication not stop throttling when the cause of throttling was no longer in effect
- Replication: Using an unresolvable host name in group_replication_group_seeds caused START GROUP_REPLICATION to fail. The fix ensures that host names in group_replication_group_seeds are validated when starting Group Replication and the list must contain at least one valid address. Invalid addresses are ignored
- Replication: The _gr_user account created by Group Replication plugin installation was not reliably removed when the plugin was uninstalled
- Replication: When starting Group Replication on an offline node, the node could be configured for replication, but fail for recovery
- Replication: When using a multi-threaded slave, applier errors displayed worker ID data that was inconsistent with data externalized in Performance Schema replication tables
- Replication: Not all Group Replication GCS debug and trace messages were enabled in debug mode
- Replication: Compiling MySQL 5.7.17 failed with a variable length array error
- Replication: In row-based replication, a message that incorrectly displayed field lengths was returned when replicating from a table with a utf8mb3 column to a table of the same definition where the column was defined with a utf8mb4 character set
- Replication: Group Replication GCS was not discarding messages when a member within the group was inactive
- Replication: Some unnecessary warnings were given when the Group Replication plugin was compiled on Windows platforms
- Replication: As assertion could be raised if the Group Replication plugin attempted to contact the server when that was no longer possible
- Replication: The GTID transaction skipping mechanism that silently skips a GTID transaction that was previously executed did not work properly for XA transactions
- Replication: After executing restarts on the group replication applier SQL thread, the plugin could no longer detect failure of the thread
- Replication: When the MTS slave applier stopped because of an (injected) error, it reported no useful information for troubleshooting
- Replication: FLUSH BINARY LOG could become slow with data replicated from many servers
- Replication: A partially failed CREATE USER, RENAME USER, or ALTER USER statement was not correctly consuming an auto-generated or specified GTID when binary logging was disabled
- Replication: Binlog_sender, which writes events from the binary log to a packet buffer and then sends the packet to the slave, did not reduce the size of the send buffer as expected
- Replication: When using a multi-threaded slave (slave_parallel_workers greater than 0) the value of Seconds_Behind_Master was incorrect when rotating a relay log
- Replication: The server prevented several replication-related administrative statements from working if the read_only system variable was enabled
- Replication: CHANGE MASTER TO for a channel that did not exist could raise an assertion
- Replication: The delay specified by the binlog_group_commit_sync_delay system variable was applied to too many binary log commit groups
- JSON: MySQL JSON source code built using with clang 3.9 raised undesired warnings
- mysqldump failed to properly quote certain identifiers in SQL statements written to the dump output
- Client preauthorization by the server was missing a length check for a length-encoded string
- The (undocumented) WINDOWS_RUNTIME_MD CMake option has been removed
- mysqld_safe failed to restart the server if a PID_FILE.shutdown file was present
- For Debian/Ubuntu packages, user-defined collation files could be overwritten during MySQL upgrades. Charset files are now marked as conffiles so that user customizations generate a prompt during upgrades whether to overwrite them
- For CREATE TABLE statements that specified the table name with a database qualifier and included a DATA DIRECTORY or INDEX DIRECTORY option, an error occurred if there was no default database
- Starting the server with performance_schema_digests_size=1 caused an abnormal exit
- MySQL failed to compile on some platforms with -DWITH_LIBWRAP=ON. CMake support now checks whether tcpd.h has proper function prototypes
- mysqld_safe did not check whether the directory named by the --basedir option existed
- Configuring CMake with -G ninja resulted in build output that was inappropriate for build platforms other than Xcode or Visual Studio
- mysqld_safe failed if the error log file named by the --log-error option was a FIFO
- For prepared statements, an alias within a subquery or derived table might cause incorrect behavior during statement execution if another alias depended on it
- mysqld_safe could fail if the --datadir option value ended with a / character
- A recent change to mysqld_safe caused the mysql.server script to be unable to start it if the base directory was specified as an absolute path that differed from the compiled-in default absolute path
- The connection_control plugin failed to compile if the Performance Schema was disabled
- Passwords did not expire correctly for accounts created using MySQL Workbench
- For System V init scripts for RPMs, the [mysqld] option-file section was being ignored for some options, such as pid-file
- Init scripts failed to launch mysqld_safe if a non-default base directory was used
- CMake now detects whether a GCC 5.3.0 loop optimization bug occurs and attempts a workaround if so
- mysqld_safe --no-defaults did not work (inadvertent consequence of an earlier bug fix)
- Semicolon (;) characters within or between statements could cause distinct digests to be generated from identical statements
- For a client linked against libmysqlclient, invalid memory access could occur during use of prepared statements
- The fix for Bug #25088048 caused the command used by mysqld_safe to start the MySQL server to no longer include the mysqld path
- Executing a stored procedure containing a query that accessed a view could allocate memory that was not freed until the session ended
- Compilation on FreeBSD 11 failed attempting to check MAP_NORESERVE, which is no longer defined
- CMake support was added for compiling using the -std=c++03 option under Developer Studio 12.5. This is now used rather than stlport by default
- Privilege checking could be incorrect for a derived table used within a multiple-table UPDATE invoked within a stored procedure or view object, for the second or subsequent execution of the object, if the derived table was merged into the outer query
- Connections from a client to a server with SSL enabled succeeded even if --ssl-mode had a value of VERIFY_CA or VERIFY_IDENTITY and the client did not provide a CA certificate
- If InnoDB statistics were incorrect, FOUND_ROWS() could return 1 even when the previous SELECT returned no rows
- CMake now sets -DWITH_NUMA=ON for Debian platforms where possible
- A query could produce incorrect results if the WHERE clause contained a dependent subquery, the table had a secondary index on the columns in the select list followed by the columns in the subquery, and GROUP BY or DISTINCT permitted the query to use a Loose Index Scan
- The DebugPrintTest and DebugPrintDeathTest unit tests did not handle divide-by-zero testing properly on the Aarch64 platform. Thanks to Alexey Kopytov for the patch
- Some account-management statements could incorrectly set the account password_lifetime value to NULL
- Changes made to mysqld_safe in recent MySQL releases require the --ledir, --mysqld, --mysqld-version options to be specified on the command line; they can no longer be specified in option files. This could cause failure of init scripts that invoke mysqld_safe. Such scripts now pass the value of the MYSQLD_OPTS environment variable as the first command-line argument to mysqld_safe, with the value set to such command line-only mysqld_safe option values as may be required. On platforms that use /etc/sysconfig/mysqld, the MYSQLD_OPTS value can be set in that file with a line such as this: MYSQLD_OPTS=" --ledir=/mysqld_ledir --mysqld=my_wrapper "
- The value of MYSQLD_OPTS can also include mysqld options for mysqld_safe to pass to mysqld
- For LOAD DATA used to insert data into an updateable view, the check to verify whether a column is actually updatable was missing
- Queries of the form SELECT NULL IN (subquery) could raise an assertion due to a missing null-pointer check
- When populating the variables_by_thread table, the Performance Schema could attempt to access session variables of other threads that were being deinitialized
- On Debian/Ubuntu platforms, the systemd startup script for MySQL ignored datadir settings in /etc/mysql/my.cnf
- For the null_audit plugin, setting the null_audit_event_record system variable improperly could cause a server exit. This variable should be set only from within the null_audit plugin, so it is now read only
- A regular expression pattern match into a large string could result in a server exit due to memory allocation failure or integer overflow
- An incorrect error was reported for CREATE TABLE statements with a large value for the CONNECTION table option. The value is now limited to 1024 bytes
- For debug builds, if the binary log was enabled, executing the audit_log plugin audit_log_filter_set_filter function could cause a server exit
- MySQL Enterprise Firewall did not record events if the audit_log plugin was installed
- EXPLAIN SELECT COUNT(*) FROM tbl_name could incorrectly report an Extra value of Select tables optimized away due to a modification introduced in MySQL 5.7.2 that caused InnoDB to count rows by traversing the clustered index instead of a smaller secondary index. The Extra value now displays Count Rows
- mysqldumpslow failed to parse timestamps in the slow query log; it had not been updated to track a change in log timestamp format
- Complete logical backups made with mysqlpump could not be restored if GTIDs were enabled
- Messages written by the audit_log plugin to the error log regarding MYSQL_AUDIT_CONNECT event failures now print the underlying error cause as well to aid debugging
- FORCE INDEX was ineffective for SELECT COUNT(*) queries
- The audit_log plugin audit_log_filter_remove_filter() function caused a server exit if given a NULL argument
- Grant tables with incorrect structure may cause problems in user management operations. As a consequence of the fix for this, for any operation that modifies a grant table, the server now checks whether the table has the expected structure and produces an error if not. mysql_upgrade must be run to update the tables to the expected structure
- Improper handling of a lock used by the version_tokens plugin and user-defined functions could result in a server exit if a UDF was called while version_tokens was being uninstalled
- The QUOTE() function could allocate excessive memory. A limit of max_allowed_packet bytes is now imposed and returns NULL with a warning for attempts to allocate more
- When attempting to locate the data directory, mysqld_safe incorrectly considered $MY_BASEDIR_VERSION/var as one of the possible locations
- The main.log_tables-big test case could be unstable on highly loaded hosts. Thanks to Laurynas Biveinis for the patch
- The rpl.rpl_key_rotation test case did not synchronize properly with the master server. Thanks to Laurynas Biveinis for the patch
- Queries that used an aggregate function with DISTINCT could produce incorrect results
- For RPM packages, the default error-log location in the deployed /etc/my.cnf file differed from the location in the installed logrotate script, causing logrotate to fail
- After performing inserts in a table containing an AUTO_INCREMENT column and then performing a SELECT operation, the LAST_INSERT_ID() returns the correct value, but the value of the mysql_insert_id() C API function was being reset to 0
- With the use_index_extensions flag of the optimizer_switch system variable disabled, some SELECT DISTINCT queries could return incorrect results
- Debian packages were missing an AppArmor-related include file and incorrectly were marked dependent on AppArmor (making it impossible to disable AppArmor by uninstalling it)
- In a replication environment, SET PASSWORD or ALTER USER could fail to execute on the slave due to failure to parse the hash string correctly
- On non-Linux Unix systems, the mysql.server startup script used the Linux command pidof rather than pgrep
- Starting multiple instances of mysqld_safe after an abnormal server exit could result in one mysqld_safe instance killing another. As a consequence of the bug fix, the mysqld_safe.pid file is no longer used
- The --help message for mysqld_safe was corrected to mention that the --no-defaults, --defaults-file, and --defaults-extra-file options, if given, must be the first argument
- The bounds check for the XML parser position stack for each level (which has a fixed depth) used the size of the array as the upper limit, and so was off by one. This is fixed by decreasing the allowable depth by one, which actually matches the maximum number of elements in the position stack. Timestamps for server-side prepared statements could be written to the binary log up to a second behind timestamps for the corresponding nonprepared statements, leading to time value differences between master and slave servers