MySQL Utilities 提供多個資料庫層級管理工具,支援 MySQL 5.1+(5.0 部分功能受限),不支援 4.0。以下介紹五大核心工具:
mysqldbcompare --server1=root@host1 --server2=root@host2 db1:db2 --run-all-tests
mysqldbcopy --source=root@host1 --destination=root@host2 db1:db2_new
mysqldbexport --server=root@localhost db1 --format=csv --export=both > db1_export.csv
執行上述工具通常需要:SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES 等權限,具體視操作而定。建議使用具備完整權限的管理帳號或專用工具帳號。
下一節將深入各工具的進階參數與實戰案例。