【问题标题】:How to find out if which type of mysql I am using in Linux, MyISAM and InnoDB ?如何确定我在 Linux、MyISAM 和 InnoDB 中使用的是哪种类型的 mysql?
【发布时间】:2014-07-15 00:51:26
【问题描述】:

我正在使用 CentO。我使用yum install mysql mysql-server 安装了 mysqld,但是现在我想知道我使用的是哪种类型的 mysql,即“MyISAM 和 InnoDB”

我试过service mysqld statusmysql -u root -p pass他们,不要显示这个信息。有没有办法找出来?

【问题讨论】:

  • 不清楚您要找出什么。 MyISAM 和 InnoDB 是您在创建表时可以选择的引擎。您是否试图找出默认值是什么?
  • 顺便说一句,在/etc/mysql/下查看MySQL的配置

标签: mysql linux centos


【解决方案1】:

启动mysql 并执行:

mysql> show engines;
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine             | Support | Comment                                                        | Transactions | XA   | Savepoints |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| PERFORMANCE_SCHEMA | YES     | Performance Schema                                             | NO           | NO   | NO         |
| CSV                | YES     | CSV storage engine                                             | NO           | NO   | NO         |
| 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         |
| MyISAM             | DEFAULT | MyISAM storage engine                                          | NO           | NO   | NO         |
| InnoDB             | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
| ARCHIVE            | YES     | Archive 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       |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 rows in set (0.00 sec)

这显示了您可用的存储引擎,以及默认的存储引擎。

【讨论】:

  • 谢谢。我说InnoDB DEFAULT 所以,我认为我正在使用 InnoDB ?
  • 你默认使用它。创建表时,您可以使用 engine=myisam 为该表使用 MyISAM。
【解决方案2】:

您可以通过SHOW ENGINES 获取支持的存储引擎。

如果想知道哪个表使用哪个存储引擎,可以使用SHOW TABLES

【讨论】:

    猜你喜欢
    • 2010-12-10
    • 2011-04-18
    • 2011-05-29
    • 1970-01-01
    • 2012-03-01
    • 2011-12-20
    • 2018-02-04
    • 2011-05-14
    • 1970-01-01
    相关资源
    最近更新 更多