Debian

如何在 Debian MySQL 包中啟用聯合儲存引擎?

  • January 13, 2012

我將如何在Debian 的軟體包中啟用額外的(在這種情況下FEDERATED)儲存引擎?mysql-server-5.1

我已經mysql-server-5.1通過 apt-get 安裝了。但SHOW ENGINES顯示聯合未啟用。

mysql> show engines;
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine     | Support | Comment                                                        | Transactions | XA   | Savepoints |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB     | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| MRG_MYISAM | YES     | Collection of identical MyISAM tables                          | NO           | NO   | NO         |
| BLACKHOLE  | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
| CSV        | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| MEMORY     | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
| FEDERATED  | NO      | Federated MySQL storage engine                                 | NULL         | NULL | NULL       |
| ARCHIVE    | YES     | Archive storage engine                                         | NO           | NO   | NO         |
| MyISAM     | DEFAULT | Default engine as of MySQL 3.23 with great performance         | NO           | NO   | NO         |
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
8 rows in set (0.00 sec)

從 MySQL 5.1.26 開始,執行伺服器預設不啟用 FEDERATED 儲存引擎;要啟用 FEDERATED,您必須使用該--federated選項啟動 MySQL 伺服器二進製文件。

或者編輯您的/etc/my.cnf全域伺服器配置文件,並在[mysqld]stanza 部分下,添加以下行:

federated

必須重新啟動 mysqld 服務才能啟用聯合引擎,預設情況下,這將在 mysql 服務的每個實例/重新啟動時啟用。

引用自:https://unix.stackexchange.com/questions/29019