mysql -u root -p123456 //进入数据库 flush tables with read lock; //锁表,准备备份数据 mysql> show master status\G //查看主节点信息 *************************** 1. row *************************** File: mysql-bin.000005 Position: 1231 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: 1 row in set (0.00 sec) mysqldump -u root -p123456 liu >liu.sql //备份liu这个数据库 mysql -u root -p123456 //进入数据库 unlock tables; //解锁 scp liu.sql [email protected]:/root/ //拷贝数据
时间: 2024-12-28 10:43:43