当我尝试使用 PDO 进行连接时收到此错误。
General error: 1651 Query cache is disabled; restart the server with query_cache_type=1 to enable it
我无法访问 MySQL 终端。我只能通过 cPanel 访问 phpmyadmin。
我该如何解决这个问题?
我尝试过这个:-
try
{
$s = $conn->query("SET query_cache_type = 1");
}
catch(PDOException $e)
{
echo $e->getMessage();
}
但这没有用。
我该如何解决这个问题?
最佳答案
这是 query_cache_type
的一种奇怪行为,如果 mysqld 进程启动时未启用它,则无法启用它。但如果它在启动时启用,您可以将 query_cache_type
设置为“关闭”,然后根据需要再次打开。
也就是说,我强烈鼓励您重新考虑使用查询缓存。 MySQL 8.0 has retired support for the query cache并将其从产品中删除。它仍然是 MySQL 5.7 中的一个功能,但从 5.7.20 开始已弃用。
关于mysql - 一般错误 : 1651 Query cache is disabled; restart the server with query_cache_type=1 to enable it,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46756040/