Clearing Caches


MySQL has a set of internal caches. These can be cleared using the FLUSH and RESET commands. For example, if we have updated user privileges by manually altering the grant tables, we can make sure that these changes roll through the system by executing a

 
 flush privileges; 

statement.

Another common use of FLUSH is to clear the query cache:

 
 flush query cache; 

This will defragment the query cache, improving performance.

The RESET statement is used in a similar way to FLUSH . For example, we can use

 
 reset query cache; 

Rather than defragmenting the query cache, this will actually clear it altogether.

A complete list of flushable and resettable variables can be found in the MySQL manual.



MySQL Tutorial
MySQL Tutorial
ISBN: 0672325845
EAN: 2147483647
Year: 2003
Pages: 261

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net