mysqldump

Python subprocess, mysqldump and pipes

家住魔仙堡 提交于 2019-12-13 12:10:20
问题 I've got a problem trying to build a easy backup/upgrade database script. The error is in the mysqldump call using subprocess: cmdL = ["mysqldump", "--user=" + db_user, "--password=" + db_pass, domaindb + "|", "gzip", ">", databases_path + "/" + domaindb + ".sql.gz"] print "%s: backup database %s \n\t[%s]" % (domain, domaindb, ' '.join(cmdL)) total_log.write("%s: backup database %s \n\t[%s] \n" % (domain, domaindb, ' '.join(cmdL))) p = subprocess.Popen(cmdL, stdout=subprocess.PIPE, stderr

Automate MySQLdump to local computer (Windows)

↘锁芯ラ 提交于 2019-12-13 11:35:06
问题 I'd like to automate a mysqldump to my computer from a remote host, and I cannot figure out how to do it. I suppose that I should run a mysqldump through an SSH tunnel, but this becomes complicated by the fact that my local computer is a Windows XP machine. I'm using putty to open a tunnel like so: putty -load "[my saved session]" -L [localport]:localhost:3306 -N Note: I can't just connect to the mysql server remotely. 回答1: Instead of PuTTY, download the command line version plink.exe . Then

mysqldump and crontab(linux) [closed]

我的未来我决定 提交于 2019-12-13 11:11:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I want to make an automatic backup of my database, so i wrote like this 00 10 * * * root mysqldump -u root -ppasswordD billing "/home/backup/database_`date '+%m-%d-%Y'`.sql" But it is not working, any ideas

MySQL全量、增量备份与恢复 (理论+实践篇)

女生的网名这么多〃 提交于 2019-12-13 08:46:20
数据备份的中要性 在生产环境中,数据的安全性是至关重要的,任何数据的丢失都可能产生严重的后果 造成数据丢失的原因 程序错误 人为错误 计算机失败 磁盘失败 灾难(如起火、地震)和偷窃 数据库备份的分类 从物理与逻辑的角度,备份可分为 物理备份:对数据库操作系统的物理文件(如数据文件、日志文件等)的备份 物理备份又可以分为脱机备份(冷备份)和联机备份(热备份) 冷备份:是关闭数据库的时候进行的 热备份:数据库处于运行状态,这种备份方法依赖于数据库的日志文件 逻辑备份:对数据库逻辑组件(如表等数据库对象)的备份 从数据库的备份策略角度,备份可分为 完全备份:每次对数据进行完整的备份 差异备份:备份那些自从上次完全备份之后被修改过的文件 增量备份:只有那些在上次完全备份或者增量备份后修改的文件才会被备份 MySQL完全备份 完全备份是对整个数据库的备份、数据库结构和文件结构的备份 完全备份保存的是备份完成时刻的数据库 完全备份是增量备份的基础 完全备份的优点 备份与恢复操作简单方便 完全备份的缺点 数据存在大量的重复 占用大量的备份空间 备份与恢复时间长 mysqldump备份数据库 MySQL数据库的备份可以采用多种方式 直接打包数据库文件夹,如/usr/local/mysql/data 使用专用备份工具 mysqldump mysqldump命令 MySQL自带的备份工具

How to take mysql database backup by using java? [duplicate]

天大地大妈咪最大 提交于 2019-12-13 08:03:39
问题 This question already has answers here : backup mysql database java code (3 answers) Closed 5 years ago . I am trying to take mysql database backup by using following code but I am getting exception like below when I run the program. Plz can anyone plz help out to solve this problem. Java Code: String path = "D:/databasbac.sql"; String username = "root"; String password = ""; String dbname = "ranjith"; String executeCmd = "<Path to MySQL>/bin/mysqldump -u " + username + " -p" + password + " -

Converting from 5.0.27 to 5.1.41, getting duplicate key errors (1062)

谁说胖子不能爱 提交于 2019-12-13 02:34:05
问题 I have a database that's currently running on a 5.0.27 server. I want to move to a new 5.1.41 server. I mysqldump'd all the files. When restoring, I get an error ERROR 1062 (23000) at line 21: Duplicate entry 'weiÃ' for key 'title' I've narrowed the failure down to this script, which I can run and it fails: -- -- Table structure for table `word` -- set names utf8; DROP TABLE IF EXISTS `word`; CREATE TABLE `word` ( `wordid` int (10) unsigned NOT NULL auto_increment, `title` char (50) NOT NULL

mysqldump_wrokbench data export advanced options not full and all mysqldump option support

末鹿安然 提交于 2019-12-12 23:23:52
问题 It's no full support and not flexible(WORKBENCH), still no solution.... I want to create dump scripts of each table in my database.... workbench 5.2.47 CE version i am using... I checked My database and all tables And options like dump stored routines, dump events in advanced options i checked....... add-locks, complete-insert, replace, hex-blob, disable-keys, order-by-primary, create-options, allow-keywords, quote-names Problems. How I save the configuration setting or all above setting I

Putting the data passed to xargs twice in one line

我是研究僧i 提交于 2019-12-12 14:53:26
问题 tmp-file contains: database_1 database_2 database_3 I want to run a command like "mysqldump DATABASE > database.sql && gzip database.sql" for each line in the above file. I've got as far as cat /tmp/database-list | xargs -L 1 mysqldump -u root -p I guess I want to know how to put the data passed to xargs in more than once (and not just on the end) EDIT: the following command will dump each database into its own .sql file, then gzip them. mysql -u root -pPASSWORD -B -e 'show databases' | sed

mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table

爷,独闯天下 提交于 2019-12-12 11:19:19
问题 mysqldump: Error 2020: Got packet bigger than 'max_allowed_packet' bytes when dumping table happens, when I do a mysqldump -u root -p database >dumpfile.sql I increased max_allowed_packet to the max value already (1073741824) to no avail. How come that one cannot dump a database with mysqls on board means? Cause may be a longblob in a data row/column which may be maximum size of 4 GB (4294967295 bytes). Could it be the network transport being used? Would there be another transport? 回答1: Use

How to restore a mysql xml database file from mysql command line?

亡梦爱人 提交于 2019-12-12 09:45:27
问题 I am running Windows XP, using the MySQL shell and PowerShell (MySQL 5.5), using XAMPP for Windows. I have an XML file which I've placed in E:\xampp\mysql\bin for convenience. I can run .\mysqldump.exe and .\mysql.exe but don't seem to be able to find the correct syntax for the type of XML file I'm using. The XML file is laid out like this: <mysqldump> <database name="export"> <table_structure name="export_rental_2006_property"> <field Field="id" Type="bigint(20)" Null="NO" Key="" Default=""