检查world库下的 city表
[root@server ~]# mysqlcheck -uroot -p -c world city
Enter password:
world.city OK
修复world库下的 city表 表存储引擎为Innodb不支持repair.
[root@server ~]# mysqlcheck -uroot -p -r world city
Enter password:
world.city
note : The storage engine for the table doesn't support repair
修复单个数据库
[root@server ~]# mysqlcheck -uroot -p -r --database world
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Enter password:
world.city
note : The storage engine for the table doesn't support repair
world.country
note : The storage engine for the table doesn't support repair
world.countrylanguage
note : The storage engine for the table doesn't support repair
修复所有数据库
[root@server ~]# mysqlcheck -uroot -p -r -A
Enter password:
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.servers OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
student.class
note : The storage engine for the table doesn't support repair
student.student
note : The storage engine for the table doesn't support repair
student.test
note : The storage engine for the table doesn't support repair
student.test1 OK
world.city
note : The storage engine for the table doesn't support repair
world.country
note : The storage engine for the table doesn't support repair
world.countrylanguage
note : The storage engine for the table doesn't support repair
mysqldump数据导出工具
用法
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
option:
-u,--user=name;
-p, --password[=name]
-h, --host=name 指定主机名或IP
-P, --port=#, 指定端口
[root@server ~]# mysqldump -uroot -p world > world.txt
Enter password: