douketangyouzh5219 2015-08-28 23:11
浏览 142

mysql查询information_schema.GLOBAL_VARIABLES以获得全文支持

I have the below code to query if mysql supports full text searching for innodb.

I am just wondering if there are any permissions that can can cause information_schema.GLOBAL_VARIABLES to not be available?

Is there a better way to find out if the database supports full text? I have tried this on a couple shared servers. I am just wondering if there are any odd setups where this won't work or cause a fatal query error.

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;
}
  • 写回答

1条回答 默认 最新

  • duancong6937 2015-08-28 23:41
    关注

    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 search for InnoDB. One of the big pushes to 5.6 was so that tables that were MyISAM in prior versions 5.5< could be converted to InnoDB in order to completely move away from MyISAM.

    评论

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?