Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

Prepared statement needs to be re-prepared

Illuminate\Database\QueryException SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared (SQL: select * from v_page_visitors where bulan = 1 and tahun = 2022)

ref: https://www.codeproject.com/Questions/1258477/General-error-1615-prepared-statement-needs-to-be

Any idea what it means ?

0 likes
6 replies
davy_yg's avatar
Level 27

@jlrdw I checked mysql table_definition_cache:

local:

    Opened tables 39

    @@table_open_cache 2048

server:

	Opened tables 177596

   @@table_open_cache 2000

In local it works whereas in the server it shows that error message.

ref: https://sqlconjuror.com/mariadb-mysql-table-open-cache-table-definition-cache/

I am really confuse how to change the table_open_cache in the server?

ref: https://dba.stackexchange.com/questions/118394/please-recommend-changes-for-my-cnf

davy_yg's avatar
davy_yg
OP
Best Answer
Level 27

The last thing I tried: show global variables like '%table_definition_cache%'

table_definition_cache 400

Still waiting for my web host to adjust the:

 SET GLOBAL table_definition_cache = 4096;
 SET GLOBAL table_open_cache = 4096;

ref: https://bugs.mysql.com/bug.php?id=42041

Please or to participate in this conversation.