Thursday 28 October 2010

HTML redirect

META HTTP-EQUIV="Refresh" CONTENT="0; URL=http://another.stite"

Between <>

Tuesday 26 October 2010

Hot-Handling of MyISAM files


I (not me, J Jorgenson via stackoverflow.com) found the following will ensure integrity of MyISAM tables for any file-level manipulation:

LOCK TABLE x WRITE; 
FLUSH TABLE x; -- closes all file handles into table by mysql.
Now you can perform file-level manipulations.
FLUSH TABLE x; -- A 'stat' of the table occurs and info-schema is updated appropriately. 
UNLOCK TABLES; 

If you do NOT lock-write your table, mysql may access it (reads or writes) while you are doing your file-level copy/manipulation. This is also the same mechanism used to allow 'myisampack', 'myisamchk' for tables on an HOT database that even has external locking disabled, without worries of corruption.