MySQL “Prepared statement needs to be re-prepared”

Ever encounter this error? The cause is a bit hazy, but a suggestion is to increase some values in the my.cnf.

More information in MySQL documentation

Suggestion found in a MySQL bugreport, increase the following values in my.cnf:

table_open_cache 128=>16384
table_definition_cache 1024=>16384
tmp_table_size 32M=>64M
join_buffer_size 256k=>512k