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

裝了 MySQL 之後不知道怎麼開始?它能做什麼、該不該用

MySQL (32-bit) 軟體圖示 MySQL (32-bit) 5.1.35 資料更新 2009-06-05 閱讀約 6 分鐘

你剛把 MySQL 裝好,打開黑色的命令提示字元視窗,輸入指令後卻不確定下一步要做什麼。或者你正在架一個網站、寫一支小程式,需要一個地方存放資料,聽別人說「用 MySQL 就好」,但你真的打開它之後,才發現跟想像中完全不一樣——沒有漂亮的視窗介面,只有一行一行的文字指令,你甚至不知道該從哪個指令開始。

一般人遇到這種狀況,直覺是去裝一個圖形介面工具,或是上網找教學影片。但問題往往不是「不會操作」,而是「不確定 MySQL 到底能幫你做到什麼程度」。它不像一般應用程式打開就能用,它是一套資料庫伺服器,需要你先理解「資料庫」的概念,才知道怎麼讓它為你工作。這類工具的核心切入點,是讓你把資料有結構地存起來、隨時查得回來,而不是像 Excel 那樣手動管理。

01MySQL 到底是做什麼用的?

它是一套關聯式資料庫管理系統,用來存放、管理、查詢資料。你可以把它想成一個「有結構的倉庫」——先把資料依照表格、欄位、關聯的方式規劃好,之後用 SQL 指令把資料寫進去或讀出來。網站會員資料、訂單紀錄、文章內容,這類需要頻繁讀寫的資料,都適合交給它處理。

02這套軟體一定要用指令操作嗎?

它本身主要透過命令提示字元操作,沒有內建圖形介面。但官方文件提到,可以搭配 phpMyAdmin、MySQL Workbench、Navicat 這些第三方工具,用滑鼠點一點就能建立表格、執行查詢、看效能狀態。如果你不習慣打指令,裝一個圖形工具會比較好上手。

03我原本用別的資料庫,可以把資料搬過來嗎?

官方說明指出,它提供工具和公用程式,可以從 Oracle、SQL Server、PostgreSQL 這些其他資料庫系統遷移過來。不過實際遷移的過程會牽涉到資料型別轉換、編碼設定等細節,建議先找官方文件確認支援的版本和步驟,再動手轉移。

04它支援寫入複雜的邏輯嗎?例如自動計算或觸發事件?

支援。官方文件明確列出它支援預存程序、觸發器和函數,意思是你可以把一段常用的 SQL 邏輯存起來重複呼叫,也可以在特定事件發生時自動執行某段程式。這對需要自動化處理資料的應用程式來說,是很常用的功能。

05資料放進去之後,要怎麼防止別人亂看?

它提供使用者認證、存取控制和加密機制。你可以建立不同的使用者帳號,分別設定他們能看哪些資料庫、能執行哪些操作,也可以啟用加密來保護傳輸中的資料。不過這些都需要你自己去設定,預設狀態下並不會自動幫你做好完整的權限控管。

06我完全沒寫過程式,適合用這套軟體嗎?

官方文件提到,要有效使用 MySQL,需要具備 SQL 語言的基本概念。如果你完全沒有接觸過資料庫,直接從指令開始會比較吃力。建議先學一點 SQL 語法,或從圖形介面工具開始操作,理解「表格、欄位、查詢」這些基本概念之後,再回來用指令會順很多。

07我只是做一個簡單的小專案,用這套會不會太重?

官方說明指出,它適合從小型應用到大規模企業系統。但如果你只是要存少量資料、不想管伺服器設定,官方文件也提到 SQLite 這類「免伺服器」的資料庫,特色是簡單、可攜、零設定。如果你的專案不需要多人同時連線、不需要複雜查詢,SQLite 可能更省事。

08這套軟體是免費的嗎?有沒有什麼限制?

它分為 Community Edition(免費、開放原始碼)和 Enterprise Edition(付費訂閱)。免費版功能已經很完整,但官方文件提到,進階功能像是即時分析、企業級技術支援,只有在付費的 Enterprise Edition 才有。如果你需要的是基本儲存和查詢,免費版通常夠用。

09我習慣用圖形介面,這套軟體有中文介面嗎?

它的介面語言是英文,而且主要操作介面是命令列。官方文件提到的第三方工具,像是 phpMyAdmin、MySQL Workbench,是否有中文介面需要另外確認。如果你很依賴中文介面,可能要考慮其他有提供在地化語言的資料庫工具,或先試用看看英文介面能不能接受。

10這套軟體在 Windows 上跑得順嗎?

官方說明指出,它支援 Windows、macOS 和 Linux,安裝過程通常是執行安裝程式、按幾個下一步。但官方文件也提醒,系統需求會依作業系統和版本而異,需要足夠的磁碟空間、記憶體和處理器效能。如果你的電腦規格比較舊,建議先確認官方列出的需求再安裝。

11我聽說 MySQL 很容易被駭,是真的嗎?

官方文件強調它提供多種驗證機制和加密選項來保護資料,但安全性很大程度取決於你怎麼設定。預設安裝完成後,如果你沒有修改預設帳號密碼、沒有設定防火牆規則,確實會有風險。建議安裝後第一件事就是設定強密碼、建立專用帳號,並關閉不需要的網路連線。

12這套軟體和 SQL Server Express 比起來,哪個比較適合我?

兩者都是免費的資料庫,但取向不同。SQL Server Express 是微軟的產品,和 Windows 環境、微軟開發工具整合較好;MySQL 則強調跨平台、支援多種程式語言。官方文件也提到,SQL Server 是 MySQL 的替代方案之一。如果你主要用微軟生態系,SQL Server Express 可能比較順;如果你需要跨平台或搭配開源技術,MySQL 會是常見選擇。

下載與官方連結

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

mysql-essential-5.1.35-win32.msi · 35.69 MB · 連結指向軟體原廠

版本紀錄

再看 5 筆

看完整版本清單

這一版改了什麼

What's new in this version:

* The .msi installer does not detect an existing root password on the initial configuration attempt. To work around this, install and configure MySQL as normal, but skip any changes to security. (There is a checkbox that allows this on the security screen of the configuration wizard.) Then check your settings:
o If the old root password and security settings are okay, you are done and can proceed to use MySQL.
o Otherwise, reconfigure with the wizard and make any changes on the second configuration attempt. The wizard will properly prompt for the existing root password and allow changes to be made.

This issue has been filed as Bug#45200 for correction in a future release.

* The Windows configuration wizard allows changes to InnoDB settings during a reconfiguration operation. For an upgrade, this may cause difficulties. To work around this, use one of the following alternatives:
o Do not change InnoDB settings.
o Copy files from the old InnoDB location to the new one.

This issue has been filed as Bug#45201 for correction in a future release.

Bugs fixed:

* Important Change: Replication: The transactional behavior of STOP SLAVE has changed. Formerly, it took effect immediately, even inside a transaction; now, it waits until the current replication event group (if any) has finished executing, or until the user issues a KILL QUERY or KILL CONNECTION statement.

This was done in order to solve the problem encountered when replication was stopped while a nontransactional slave was replicating a transaction on the master. (It was impossible to roll back a mixed-engines transaction when one of the engines was nontransactional, which meant that the slave could not safely re-apply any transaction that had been interrupted by STOP SLAVE.) (Bug#319, Bug#38205)

See also Bug#43217.

* Partitioning: When a value was equal to a PARTITION ... VALUES LESS THAN (value) value other than MAXVALUE, the corresponding partition was not pruned. (Bug#42944)
* Replication: Unrelated errors occurring during the execution of RESET SLAVE could cause the slave to crash. (Bug#44179)
* Replication: The --slave-skip-errors option had no effect when using row-based logging format. (Bug#39393)
* Replication: The following erors were not correctly reported:
o Failures during slave thread initialization

o Failures while initializing the relay log position (immediately following the starting of the slave thread)

o Failures while processing queries passed through the --init_slave option.

Information about these types of failures can now be found in the output of SHOW SLAVE STATUS. (Bug#38197)
* Replication: Killing the thread executing a DDL statement, after it had finished its execution but before it had written the binlog event, caused the error code in the binlog event to be set (incorrectly) to ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED, which caused replication to fail. (Bug#37145)

See also Bug#27571, Bug#22725.

* Replication: Column alises used inside subqueries were ignored in the binary log. (Bug#35515)
* Valgrind warnings for the DECODE(), ENCRYPT(), and FIND_IN_SET() functions were corrected. (Bug#44358, Bug#44365, Bug#44367)
* On Windows, entries for build-vs9.bat and build-vs9_x64.bat were missing in win/Makefile.am. (Bug#44353)
* Incomplete cleanup of JOIN_TAB::select during the filesort of rows for a GROUP BY clause inside a subquery caused a server crash. (Bug#44290)
* Not all lock types had proper descriptive strings, resulting in garbage output from mysqladmin debug. (Bug#44164)
* Use of HANDLER statements with INFORMATION_SCHEMA tables caused a server crash. Now HANDLER is prohibited with such tables. (Bug#44151)
* Invoking SHOW TABLE STATUS from within a stored procedure could cause a Packets out of order error. (Bug#43962)
* myisamchk could display a negative Max keyfile length value. (Bug#43950)
* On 64-bit systems, a key_buffer_size value larger than 4GB could couse MyISAM index corruption. (Bug#43932)
* mysqld_multi incorrectly passed --no-defaults to mysqld_safe. (Bug#43876)
* SHOW VARIABLES did not properly display the value of slave_skip_errors. (Bug#43835)
* On Windows, a server crash occurred for attempts to insert a floating-point value into a CHAR column with a maximum length less than the converted floating-point value length. (Bug#43833)
* Incorrect initialization of MyISAM table indexes could cause incorrect query results. (Bug#43737)
* libmysqld crashed when it was reinitialized. (Bug#43706, Bug#44091)
* InnoDB uses random numbers to generate dives into indexes for calculating index cardinality. However, under certain conditions, the algorithm did not generate random numbers, so ANALYZE TABLE did not update cardinality estimates properly. A new algorithm has been introduced with better randomization properties, together with a system variable, innodb_use_legacy_cardinality_algorithm, that controls which algorithm to use. The default value of the variable is 1 (ON), to use the original algorithm for compatibility with existing applications. The variable can be set to 0 (OFF) to use the new algorithm with improved randomness. (Bug#43660)
* UNION of floating-point numbers did unnecessary rounding. (Bug#43432)
* ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME failed when the database contained views. (Bug#43385)
* Certain statements might open a table and then wait for an impending global read lock without noticing whether they hold a table being waiting for by the global read lock, causing a hang. Affected statements are SELECT ... FOR UPDATE, LOCK TABLES ... WRITE, TRUNCATE TABLE, and LOAD DATA INFILE. (Bug#43230)
* Using an XML function such as ExtractValue() more than once in a single query could produce erroneous results. (Bug#43183)

See also Bug#43937.

* Full-text prefix searches could hang the connection and cause 100% CPU consumption. (Bug#42907)
* InnoDB had excessive contention for a character set mutex. (Bug#42649)
* Incorrect elevation of warning messages to error messages for unsafe statements caused a server crash. (Bug#42640)
* CHECK TABLE suggested use of REPAIR TABLE for corrupt tables for storage engines not supported by REPAIR TABLE. Now CHECK TABLE suggests that the user dump and reload the table. (Bug#42563)
* Compressing a table with the myisampack utility caused the server to produce Valgrind warnings when it opened the table. (Bug#41541)
* For a MyISAM table with DELAY_KEY_WRITE enabled, the index file could be corrupted without the table being marked as crashed if the server was killed. (Bug#41330)
* Killing an INSERT ... SELECT statement for a MyISAM table could cause table corruption if the table had indexes. (Bug#40827)
* A multiple-table DELETE IGNORE statement involving a foreign key constraint caused an assertion failure. (Bug#40127)
* Multiple-table UPDATE statements did not properly activate triggers. (Bug#39953)
* The mysql_setpermission operation for removing database privileges removed global privileges instead. (Bug#39852)
* A stored routine contain a C-style comment could not be dumped and reloaded. (Bug#39559)
* In an UPDATE or DELETE via a secondary index, InnoDB did not store the cursor position. This made InnoDB crash in semi-consistent read while attempting to unlock a nonmatching record. (Bug#39320)
* The functions listed in Section 11.13.4.2.3, “Creating Geometry Values Using MySQL-Specific Functions”, previously accepted WKB arguments and returned WKB values. They now accept WKB or geometry arguments and return geometry values.

The functions listed in Section 11.13.4.2.2, “Creating Geometry Values Using WKB Functions”, previously accepted WKB arguments and returned geometry values. They now accept WKB or geometry arguments and return geometry values. (Bug#38990)

* On WIndows, running the server with myisam_use_mmap enabled caused MyISAM table corruption. (Bug#38848)
* CHECK TABLE did not properly check whether MyISAM tables created by servers from MySQL 4.0 or older needed to be upgraded. This could cause problems upgrading to MySQL 5.1 or higher. (Bug#37631)
* An UPDATE statement that updated a column using the same DES_ENCRYPT() value for each row actually updated different rows with different values. (Bug#35087)
* For shared-memory connections, the read and write methods did not properly handle asynchronous close events, which could lead to the client locking up waiting for a server response. For example, a call to mysql_real_query() would block forever on the client side if the executed statement was aborted on the server side. Thanks to Armin Schöffmann for the bug report and patch. (Bug#33899)
* CHECKSUM TABLE was not killable with KILL QUERY. (Bug#33146)
* myisamchk and myisampack were not being linked with the library that enabled support for * filename pattern expansion. (Bug#29248)
* For InnoDB tables that have their own .ibd tablespace file, a superfluous ibuf cursor restoration fails! message could be written to the error log. This warning has been suppressed. (Bug#27276)
* COMMIT did not delete savepoints if there were no changes in the transaction. (Bug#26288)
* Several memory allocation functions were not being checked for out-of-memory return values. (Bug#25058)