简体   繁体   中英

MySql query cache settings

How can I set the query cache of MySql?

My "my.ini" file doesn't contain the variable mysql_query_type or mysql_query_size at all...

How are these set?

Can they be set from PHP?

Thanks

The mysql query cache size configuration is usually located in the my.ini . Since it is a server configuration, it usually shouldn't be allowed that scripts like php change its configuration. If I remember correctly, the mysql query cache is usually on unless you haven't compiled mysql without it.

Here are more detailed information on how it works, how it is configured, and what initialization variables are to be used.

Here are more detailed information on how you can modify the behaviour using dynamic system variables.

I haven't used phpmyadmin for a long time, so I can't answer on how these values are easily accessible. With SHOW VARIABLES LIKE '%query%'; it should be easy to access them anyway.

You may enable query caching by altering the query-cache-type value in your MySQL configuration file. You may not change it from PHP, however you may clear it by sending the following query to MySQL: RESET QUERY CACHE .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM