备份数据

  1. mysqldump -uroot -P3306 -p -h 192.168.103.77 --databases db1 db2 > sit-20210304.sql

导入数据

source /home/app/sit-20210304.sql;

Got error: 1066: Not unique table/alias

mysqldump: Got error: 1066: Not unique table/alias: 'admin_user' when using LOCK TABLES

方法1:
添加参数 --single-transaction 正常导出(已测试)
mysqldump --single-transaction --databases tsconsole>/data/tsconsole180814.sql

方法2:
将/etc/my.cnf 的
lower_case_table_names=1添加注释
重启mysql,执行导出

CTID警告

Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.  
使用 --set-gtid-purged=OFF 关闭警告
不影响备份,可以不用处理