我有下面的代码来查询mysql是否支持innodb的全文搜索。
我只是想知道是否有任何权限可能导致 information_schema.GLOBAL_VARIABLES 不可用?
有没有更好的方法来查明数据库是否支持全文?我已经在几个共享服务器上尝试过这个。我只是想知道是否有任何奇怪的设置不起作用或导致致命的查询错误。
function supports_full_text()
{
$result = $this->db->query("SELECT COUNT(*) as count FROM information_schema.GLOBAL_VARIABLES WHERE Variable_name = 'innodb_ft_cache_size'");
return $result->row()->count > 0;
}
最佳答案
Full-text searches are supported for InnoDB and MyISAM tables only. FULLTEXT index support for InnoDB tables requires MySQL 5.6.4 or higher.
5.6> supports fulltext搜索 InnoDB。 5.6 的一大插入力是,之前版本 5.5< 中的 MyISAM 表可以转换为 InnoDB,以便完全摆脱 MyISAM。
关于php - mysql 查询 information_schema.GLOBAL_VARIABLES 以获得全文支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32281047/