MySQL

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

MY sql

Backup:

mysqldump -h ${DBSERVER} --single-transaction -u ${DBUSER} -p${DBPASSWD} ${DBNAME} | gzip > ${DB_BACKUP_PATH}/${DBNAME}/${DBNAME}_${BACKUP_TIME}.sql.gz

Restore:

gunzip gzip > ${DB_BACKUP_PATH}/${DBNAME}/${DBNAME}_${BACKUP_TIME}.sql.gz | mysql  -u ${DBUSER} -p${DBPASSWD}  ${DBNAME}

禁用外键约束

SET FOREIGN_KEY_CHECKS=0;

启动外键约束
SET FOREIGN_KEY_CHECKS=1;

查看当前FOREIGN_KEY_CHECKS的值可用如下命令

SELECT @@FOREIGN_KEY_CHECKS;

1

 .

 

3 info@azwise.us

1858-757-7257

simple orange house hi9530 Padgett Street #108, San Diego, CA   92126

wechat

© Copyright 2023 AZWISE Technologies. All Rights Reserved

Search