找到mysqldump所在目錄
which mysqldump
輸出信息
/usr/bin/mysqldump
備份命令
/usr/bin/mysqldump -hhost -uuser -p1234567 dbName
SecureCRT上面出現了很長的SQL語句,是數據庫導出之后的SQL語句。需將這些SQL語句存入文件中。修改后的備份命令:
/usr/bin/mysqldump -hhost -uuser -p1234567 dbName > /usr/dbName_backup_20160409.sql
輸出信息:
Warning: Using a password on the command line interface can be insecure.
檢測備份是否已經完成。
which dbName_backup_20160409.sql
輸出信息:
/usr/bin/which: no dbName_backup_20160409.sql in (/data/mysqldata/scripts:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
不知道是備份文件不存在,還是查找文件的linux命令錯誤。新命令:
find / -name "dbName_backup_20160409.sql"
輸出信息:
/usr/dbName_backup_20160409.sql
查看備份文件
less /usr/dbName_backup_20160409.sql
將備份文件用SecureCRT下載到本地
在SecureCRT的Xmodem/Ymodem/Zmodem設置上傳下載目錄。使用命令:
sz /usr/dbName_backup_20160409.sql