I am encountering data corruption every time MySQL is restarted. The restart is done through scripts and I encounter the following error:
myisamchk: MyISAM file /global/mysql/mysql/db.MYI
myisamchk: warning: 1 client is using or hasn't closed the table
properly
MyISAM-table '/global/mysql/mysql/db.MYI' is usable but should be fixed
After I googled, I found that running myisamchk on the table was the most commonly provided solution and tried it:
bash-2.05# /opt/mysql/mysql/bin/myisamchk -r /global/mysql/mysql/db.MYI
- recovering (with sort) MyISAM-table '/global/mysql/mysql/db.MYI'
Data records: 6
- Fixing index 1
- Fixing index 2
bash-2.05# echo $?
0
but the problem resurfaces every time the DB is restarted!! 
Got ideas?

and left me wondering what the heck?