我是靠谱客的博主 安详啤酒,最近开发中收集的这篇文章主要介绍mysql8查询缓存弃用,常规错误:1651查询缓存已禁用;使用query_cache_type = 1重新启动服务器以启用它...,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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?

解决方案

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.

最后

以上就是安详啤酒为你收集整理的mysql8查询缓存弃用,常规错误:1651查询缓存已禁用;使用query_cache_type = 1重新启动服务器以启用它...的全部内容,希望文章能够帮你解决mysql8查询缓存弃用,常规错误:1651查询缓存已禁用;使用query_cache_type = 1重新启动服务器以启用它...所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部