Tag Archives: ERROR 1615 (HY000): Prepared statement needs to be reprepared

[Solved] MySQL Error: ERROR 1615 (HY000): Prepared statement needs to be re-prepared

Today’s company’s project view query reported an error. Find the reason for the code and view, and find that there is no problem, and the view will make an error. Errors are reported as follows:

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

Many cases are caused by unreasonable setting of MySQL variable values. Adjust the following values:

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 occurs suddenly in a stored procedure that can normally run

It may be caused by unreasonable MySQL configuration parameters. The solutions are as follows

SHOW VARIABLES LIKE ‘%table_ open_ cache%’;
Variable_ name                           Value
table_ open_ cache                     two thousand
table_ open_ cache_ instances     one

SHOW VARIABLES LIKE ‘%table_ definition_ cache%’;
Variable_ name               Value
table_ definition_ cache   four thousand

adjust variable value
— table_ open_ cache
SET GLOBAL table_ open_ cache=16384;
SET GLOBAL table_ definition_ cache=16384;