MySQL报错ERROR 1615 (HY000): Prepared statement needs to be re-prepared

今天公司的项目视图查询报错。找了代码和视图的原因,发现表示没有问题的,视图就出错了。报错如下:

ERROR 1615 (HY000): Prepared statement needs to be re-prepared

很多情况是mysql的变量值设置不合理引起的,调整以下值:

table_open_cache 64=16384
table_definition_cache 256=16384
mysql set global table_open_cache=16384;

mysql set global table_definition_cache=16384;

 


 

 

如果一个平时能正常运行的存储过程,突然出现ERROR 1615 (HY000):Prepared statement needs to be re-prepared的错误

那么有可能是mysql的配置参数不合理引起的,解决方法如下

SHOW VARIABLES LIKE '%table_open_cache%';
Variable_name                         Value  
table_open_cache                   2000 
table_open_cache_instances   1   

SHOW VARIABLES LIKE '%table_definition_cache%';
Variable_name              Value  
table_definition_cache  4000  

调整变量值
-- table_open_cache
SET GLOBAL table_open_cache=16384;
SET GLOBAL table_definition_cache=16384;

posted @ 2021-08-20 07:21  跟着阿笨一起玩.NET  阅读(1131)  评论(0编辑  收藏  举报