大家好,
使用mysqldump,我导出数据库的模式和数据。
这是我的密码:
self.BACKUP_PATH = 'SqlBackup'
self.FILE_NAME_SCHEMA = self.BACKUP_PATH + '/tribot_schema_pack.sql'
self.FILE_NAME_DATA_PACK = self.BACKUP_PATH + '/tribot_data_pack.sql'
self.MYSQL_SETTINGS = '-h ' + self.DB_HOST + ' -u ' + self.DB_USER + ' --password=' + self.DB_USER_PASSWORD
self.DUMP_CODE = self.MYSQL_DUMP_DIR + '/mysqldump ' + self.MYSQL_SETTINGS
self.DUMP_MYSQL_CODE = self.MYSQL_DUMP_DIR + '/mysql ' + self.MYSQL_SETTINGS
command_schema = '%s --no-data --skip-triggers %s > %s' % \
(self.DUMP_CODE, self.DB_NAME, pipes.quote(self.FILE_NAME_SCHEMA))
command_data = '%s --no-create-info %s > %s' % \
(self.DUMP_CODE, self.DB_NAME, pipes.quote(self.FILE_NAME_DATA_PACK))
subprocess.Popen(command_schema, shell=True).wait()
subprocess.Popen(command_data, shell=True).wait()
如何在导出时不导入索引和触发器?
1条答案
按热度按时间zkure5ic1#
我没有得到这样的触发器:——跳过触发器
对于键我,不幸的是,去掉了我出现在样本上的键;