如何找到MySQL临时表存储引擎 [英] How to find MySQL temporary table storage engine

查看:418
本文介绍了如何找到MySQL临时表存储引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在使用临时表,我想知道临时表存储引擎(InnoDB,MyISAM ....)

Hi I am working with Temporary table and I would like to know the temporary table storage Engine (InnoDB, MyISAM .... )

我使用以下代码找到,但它不显示我的存储引擎。

I am using the following code to find out but it is not showing me the storage Engine.

$engine="SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND `TABLE_NAME`='temporary_table'";
$export = mysql_query($engine, $connection) or die ("Sql error : ".mysql_error());
while ($row = mysql_fetch_array($export, MYSQL_BOTH)) {
    printf ("ENGINE: %s ---", $row[0]);
}

但是同样的代码工作,当我试图找到物理存储引擎在我的数据库中的表?

But the same code is working when I try to find the storage engine for Physical tables in my DB?

任何帮助是非常感谢。谢谢。

Any Help is much appreciated.!! Thank you.

推荐答案

很遗憾


目前,[INFORMATION_SCHEMA。] TABLES表不列出TEMPORARY表。

Currently, the [INFORMATION_SCHEMA.]TABLES table does not list TEMPORARY tables.

我建议解析 SHOW CREATE TABLE temporary_table;

只提取此返回值的ENGINE:

To extract only the ENGINE of this return value:

$rset = mysql_query('SHOW CREATE TABLE temporary_table;')
$row = mysql_fetch_array($rset, MYSQL_BOTH);
preg_match('/ENGINE\=(?P<engine>\w+)/', $row[1], $matches);
echo $matches['engine'];

这篇关于如何找到MySQL临时表存储引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆