General error: 1651 Query cache is disabled; restart the server with query_cache_type=1 to enable it

☆樱花仙子☆ 提交于 2019-12-04 07:05:47

问题


I am getting this error when I'm trying to connect using PDO.

General error: 1651 Query cache is disabled; restart the server with query_cache_type=1 to enable it

I do not have access to MySQL terminal. I only have access to phpmyadmin via cPanel.

How can I fix this?

I tried this :-

try
{
  $s = $conn->query("SET query_cache_type = 1");
}
catch(PDOException $e)
{
  echo $e->getMessage();
}

But this didn't work.

How can I fix this?


回答1:


This is a strange behavior of query_cache_type such that cannot be enabled if it wasn't enabled when the mysqld process started. But if it was enabled at startup, you can set query_cache_type "off" and then back on again if you need to.

That said, I would strongly encourage you to reconsider using the query cache at all. MySQL 8.0 has retired support for the query cache and removed it from the product. It's still a feature in MySQL 5.7, but it's deprecated as of 5.7.20.



来源:https://stackoverflow.com/questions/46754157/general-error-1651-query-cache-is-disabled-restart-the-server-with-query-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!