On Mar 17, 2004, at 4:41 PM, Paul DuBois wrote:
At 14:06 -0800 3/17/04, James Hughes wrote:I want to set up some automated table checking and the research I've done has left me scratching my head.
I'm looking for a definitive answer to this thread: http://marc.theaimsgroup.com/?l=mysql&m=106159147322752&w=2
With respect to MyISAM tables in 4.0, there seems to be two different scenarios:
1) Daemon running with "--skip-external-locking" a) I do NOT need to shut down the daemon b) I do NOT need to flush the tables c) CHECK TABLE tbl_name
--OR--
a) Shut down the daemon b) mysqladmin flush-tables c) myisamchk -m tbl_name
2) Daemon running without "--skip-external-locking" a) I do NOT need to shut down the daemon b) I do NOT need to flush the tables c) CHECK TABLE tbl_name
--OR--
a) I do NOT need to shut down the daemon b) mysqladmin flush-tables c) myisamchk -m tbl_name
So, other than the clarification about CHECK TABLE, everything above looks A-OK?
I'm a little confused about the "CHECK TABLE" sql statement. In the docs (http://www.mysql.com/doc/en/CHECK_TABLE.html) it says "On MyISAM tables, it's the same thing as running myisamchk --medium-check tbl_name on the table."
If that's accurate then you couldn't safely run it on a mysqld daemon that's running with "--skip-external-locking"! That would also imply that you need to flush the tables first!
However in the thread above, Paul Dubois claims "You can also use CHECK TABLE, REPAIR TABLE, which have no problem of interaction with the server, and can be issued from remote clients."
So either CHECK TABLE (without any options) isn't the same thing as "myisamchk --medium-check" or Paul is mistaken.
It's probably a bad idea to believe anything that DuBois character says.
He is an awfully shifty lookin' fella. ;)
"same thing" means "has the same effect as", not "does the check the same way that myisamchk does".
CHECK TABLE cannot possibly have any problem of interaction with the server, because the way that CHECK TABLE operates is to instruct the server to do the work. This doesn't mean that you couldn't have a problem if some other external program happens to try to mess around with the table at the same time.
This was my gut feeling, but programmers do stupid stuff all the time - I mean... except for the MySQL crew, of course! Thanks for the clarification.
I should probably qualify this by saying that I'm looking for a "Best Practices" type answer rather than a technical discussion of all the various exceptions to the rule.
Thanks for any insight!
-James Hughes
-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com
MySQL Users Conference: April 14-16, 2004 http://www.mysql.com/uc2004/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]