Search code examples
phpmysql

How to get rid of MySQL error 'Prepared statement needs to be re-prepared'


I've rewritten my site php-code and added MySQL Stored Procedures.

In my local version everything works fine but after I uploaded my site to hosting server I'm constantly getting fatal error 'Prepared statement needs to be re-prepared'.

Sometimes page loads, sometimes loading fails and I see this error. What's that?


Solution

  • This is a possibility: MySQL bug #42041

    They suggest upping the value of table_definition_cache.

    You can read about statement caching in the MySQL docs.