mysqldump

Why is a mysqldump with single-transaction more consistent than a one without?

依然范特西╮ 提交于 2019-12-05 05:42:23
I have gone through the manual and it was mentioned that every transaction will add a BEGIN statement before it starts taking the dump. Can someone elaborate this in a more understandable manner? Here is what I read: This option issues a BEGIN SQL statement before dumping data from the server. It is useful only with transactional tables such as InnoDB and BDB, because then it dumps the consistent state of the database at the time when BEGIN was issued without blocking any applications." Can some elaborate on this? Eric Petroelje Since the dump is in one transaction, you get a consistent view

Mysql增量备份之Mysqldump & Mylvmbackup

て烟熏妆下的殇ゞ 提交于 2019-12-05 05:12:25
简单介绍 备份类型 备份方式 热备份:备份期间不需要服务停机,业务不受影响; 温备份:备份期间仅允许读的请求; 冷备份:备份期间需要关闭 Mysql 服务或读写请求都不受影响; 完全备份: full backup 备份全部数据集; 增量备份: incrementalbackup 上次完全备份或增量备份以来改变的数据; 差异备份: differentialbackup 上次完全备份以来改变的数据; 完全 + 增量 备份方式恢复用到的备份文件: 完全备份 + 增量备份 + 二进制文件; 完全+差异备份方式恢复用到的备份文件:完全备份+增量备份+二进制文件; 逻辑备份 优点 缺点 逻辑备份可以使用编辑器或文本处理工具进行编辑或查看; 恢复非常简单; 比较灵活; 与存储引擎无关; 有助于避免数据损坏; 逻辑备份可以使用编辑器或文本处理工具进行编辑或查看; 恢复非常简单; 比较灵活; 与存储引擎无关; 有助于避免数据损坏; 物理备份 优点 缺点 备份与恢复数据比较简单; InnoDB 与 MyISAM 的物理备份容易跨平台、操作系统和 Mysql 版本; 恢复速度比较快,不需要重新构建索引; InnoDB 的原始文件会比逻辑备份大得多; 物理备份不是总可以跨平台、操作系统及 Mysql 版本; 文件名大小写敏感和浮点格式有可能会有问题 备份对象: 数据文件、配置文件、代码:存储过程,存储函数

Is there a tool to dump a Neo4j graph as Cypher and re-load it from Cypher?

↘锁芯ラ 提交于 2019-12-05 04:36:08
Everyone familiar with MySQL has likely used the mysqldump command which can generate a file of SQL statements representing both the schema and data in a MySQL database. These SQL text files are commonly used for many purposes: backups, seeding replicas, copying databases between installations (- copy prod DBs to staging environments etc) and others. Is there a similar tool for Neo4j that can dump an entire graph into a text file of Cypher statements, that when executed on an empty database would reconstruct the original data? Thanks. In neo4j version 2 (e.g. 2.0.0M3), using neo4j-shell, you

mysqldump command not working?

做~自己de王妃 提交于 2019-12-05 01:32:23
I am using mysqldump to take backup of my database, but the command is not working.. the command i am using is mysqldump -u root dbname> 'c:\backupdatafolder\backup.sql' i am running this command in MySQL cli but not running,..is there any thing wrong in the command? You are supposed to run that on the command line of your operating system not on the MySQL CLI. cd to the bin folder of MySQL first, something like C:\mysql\bin or wherever your MySQL is installed on If the mysqldump can not be identified by your CMD prompt (I believe you are using Windows), then you first have to go to the bin

第九章 MySQL的备份和恢复

不羁的心 提交于 2019-12-05 00:42:13
一.备份的原因 运维工作的核心简单概括就两件事: 1)第一个是保护公司的数据. 2)第二个是让网站能7*24小时提供服务(用户体验)。 1)备份就是为了恢复。 2)尽量减少数据的丢失(公司的损失) 二.备份的类型 冷备份: 这些备份在用户不能访问数据时进行,因此无法读取或修改数据。这些脱机备份会阻止执行任何使用数据的活动。这些类型的备份不会干扰正常运行的系统的性能。但是,对于某些应用程序,会无法接受必须在一段较长的时间里锁定或完全阻止用户访问数据。 温备份: 这些备份在读取数据时进行,但在多数情况下,在进行备份时不能修改数据本身。这种中途备份类型的优点是不必完全锁定最终用户。但是,其不足之处在于无法在进行备份时修改数据集,这可能使这种类型的备份不适用于某些应用程序。在备份过程中无法修改数据可能产生性能问题。 热备份: 这些动态备份在读取或修改数据的过程中进行,很少中断或者不中断传输或处理数据的功能。使用热备份时,系统仍可供读取和修改数据的操作访问。 三.备份的方式 1.逻辑备份: 基于SQL语句的备份 1)binlog 2)into outfile mysql> select * from world.city into outfile '/tmp/world_city.data'; 3)mysqldump 4)replication 5)mysqlbinlog 2.物理备份:

Getting 0KB of size file while backup mysql database using mysql dump

亡梦爱人 提交于 2019-12-04 20:33:43
I am using below code to backup my database using php script but I am getting 0KB size file. How can I backup my full database with all routines and functions? $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $dbname='mydatabase'; $toDay = date('d-m-Y'); //exec("mysqldump --user=$dbuser --password='$dbpass' --host=$dbhost --single-transaction $dbname > D:\Sql_Backups/".$toDay."_DB.sql"); //exec('mysqldump --user=$dbuser --password=$dbpass --host=$dbhost $dbname > D:\Sql_Backup/file.sql'); exec ("mysqldump --routines --h $dbhost --u $dbuser --p $dbpass --single-transaction $dbname > D:

MySQL--11 备份的原因

半世苍凉 提交于 2019-12-04 19:09:26
目录 一.备份的原因 二.备份的类型 三.备份的方式 四.备份策略 五.备份工具 六、企业故障恢复案例 1.模拟环境 2.模拟恢复数据过程: 一.备份的原因 运维工作的核心简单概括就两件事: 1)第一个是保护公司的数据. 2)第二个是让网站能7*24小时提供服务(用户体验)。 1)备份就是为了恢复。 2)尽量减少数据的丢失(公司的损失) 二.备份的类型 冷备份: 这些备份在用户不能访问数据时进行,因此无法读取或修改数据。这些脱机备份会阻止执行任何使用数据的活动。这些类型的备份不会干扰正常运行的系统的性能。但是,对于某些应用程序,会无法接受必须在一段较长的时间里锁定或完全阻止用户访问数据。 温备份: 这些备份在读取数据时进行,但在多数情况下,在进行备份时不能修改数据本身。这种中途备份类型的优点是不必完全锁定最终用户。但是,其不足之处在于无法在进行备份时修改数据集,这可能使这种类型的备份不适用于某些应用程序。在备份过程中无法修改数据可能产生性能问题。 热备份: 这些动态备份在读取或修改数据的过程中进行,很少中断或者不中断传输或处理数据的功能。使用热备份时,系统仍可供读取和修改数据的操作访问。 三.备份的方式 逻辑备份: 1. 逻辑备份 1)binlog 2)into outfile mysql> select * from world.city into outfile '/tmp

MySQL --12 备份的分类

人盡茶涼 提交于 2019-12-04 19:09:19
目录 物理备份(Xtrabackup) 1.全量备份 2.增量备份及恢复 3.差异备份及恢复 4.实战:企业级增量恢复实战 物理备份(Xtrabackup) Xtrabackup安装 #下载epel源 wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-6.repo #安装依赖 yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL #下载Xtrabackup wget httpss://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.4/binary/redhat/6/x86_64/percona-xtrabackup-24-2.4.4-1.el6.x86_64.rpm 备份方式(物理备份) 1)对于非innodb表(比如myisam)是直接锁表cp数据文件,属于一种温备。 2)对于innodb的表(支持事务),不锁表,cp数据页最终以数据文件方式保存下来,并且把redo和undo一并备走,属于热备方式。 3)备份时读取配置文件/etc/my.cnf 1.全量备份 #全备 [root@db01 data]#

MySql数据库导入导出

喜欢而已 提交于 2019-12-04 18:32:46
MySql数据库导入导出 1、导出整个数据库 mysqldump -u 用户名 -p 数据库名 > 存放位置 比如: mysqldump -u root -p project > c:/a.sql (导出project数据库已经经过亲自测试,成功!) 2.导出一个表的结构,并且带表中的数据 mysqldump -u 用户名 -p 数据库名 表名 > 导出的文件名 mysqldump -u root -p project position > c:/a.sql (测试,成功!) 只导出表结构,不带表中的数据: mysqldump -d -u root -p project position > c:/a.sql (测试,成功!) 3.导出一个数据库结构 mysqldump -u wcnc -p -d --add-drop-table smgp_apps_wcnc >d:wcnc_db.sql -d 没有数据 --add-drop-table 在每个create语句之前增加一个drop table 4.导入数据库 1、常用source 命令 进入mysql数据库控制台, d:/program files/mysql/mysql server 5.1/bin > mysql -u root -p d:/program files/mysql/mysql server 5.1/bin >

Import of 8GB mysql dump takes a long time

≯℡__Kan透↙ 提交于 2019-12-04 17:35:21
问题 I've got an 8GB MYSQL database dump of InnoDB tables created with mysqldump. I import the data with: mysql -uroot -p my_db < dump.sql An 5 GB dump of the DB was imported within an hour. The 8 GB dump takes 50 hour and counting. When I inspected the processlist with SHOW PROCESSLIST; Most of the time there was a single INSERT query visible with state "'freeing items" Is there a way, besides copying the raw files, to speed up the import process? 回答1: The trick really, is to ensure that the