2011年2月14日 星期一

fix mysql upgrade

1.after your migration mysql from old version to new version
you can use mysql_upgrade command to force upgrade to new version with schema
#mysql_upgrade -u root -pgreen@123

3.check mysql all tables
#mysqlcheck --check --all-databases -u root -pgreen@123

3.check and fix mysql all tables
#mysqlcheck --check-upgrade --all-databases -u root -pgreen@123

4.update all privilege table
#mysql_fix_privilege_tables -u root --password=green@123 --verbose

how to repair table

1.use mysqlcheck to repair one table
#mysqlcheck -r mytable username -u root -pgreen@123

2.use repair table command
#mysql -u root -pgreen@123
->use mytable
->repair table username