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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值