mysqldump

Is there a faster way to load mysqldumps? [duplicate]

风流意气都作罢 提交于 2019-12-20 09:37:02
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Speeding up mysql dumps and imports mysqldump is reasonably fast, but dumps of a medium-sized database (20-30 megs) take several minutes to load using mysql my_database < my_dump_file.sql Are there some mysql settings I can tune to speed up the load? Is there a better way to load saved data? I've experimented using the mysqlimport utility with CSV-based dumps. These load slightly--but not appreciably--faster. I

mysqldump entire structure but only data from selected tables in a single command

穿精又带淫゛_ 提交于 2019-12-20 08:09:40
问题 My database has 3 tables: table1, table2 and table3 I would like to do a mysqldump on this database with the following conditions: Dump structure for all tables Only dump data for table1 and table2, ignore data in table3 Currently, I do this with 2 mysqldump statements mysqldump -u user -p -d db > db_structure.sql mysqldump -u user -p db --ignore-table=db.table3 > table1_and_table2_data.sql Import them in the same order they were dumped (structure, then data from table1 and table2) Is there a

Error importing MySQL data across platforms (MAMP to WIMP)

╄→гoц情女王★ 提交于 2019-12-20 07:10:07
问题 I've dumped a MySQL database I have on my local MAMP server into a .sql file. Usually, it's easy enough for me to import that file to my production Linux servers without a hitch. However, my current client runs MySQL on WIMP, and when import the MAMP-generated .sql dump into my WIMP mysql environment (Using pphpMyAdmin) I get a "File could not be read" error? Any ideas of what I'm bumping up against, or what to check? Thanks- EDIT: My initial explanation was unclear- I'm trying to export out

mysql备份

一个人想着一个人 提交于 2019-12-20 07:04:11
常用备份命令 文章目录 1.备份单独的库(实际是恢复之前的表,前提是自己建库) 2.备份某库单独的表 3.保存数据结构备份数据库 -B 4.备份所有数据库 -A 5.备份所有存储过程和函数 6.恢复单张表的某些数据 1.备份单独的库(实际是恢复之前的表,前提是自己建库) [root@Centos7 ~]# mysqldump hellodb > /data/backup/hellodb.sql [root@Centos7 ~]# mysql -e ‘create hello’ [root@Centos7 ~]# mysql hello < /data/backup/hellodb.sql 2.备份某库单独的表 [root@Centos7 ~]#mysqldump hello students > /data/backup/students.sql [root@Centos7 ~]# mysql hello < /data/backup/toc.sql 3.保存数据结构备份数据库 -B [root@Centos7 ~]#mysqldump -B hello > /data/backup/hello.sql [root@Centos7 ~]#mysql < /data/backup/hello.sql 4.备份所有数据库 -A [root@Centos7 ~]#mysqldump -A

MySQL Syntax error when locally importing dump from Amazon MySQL RDS?

删除回忆录丶 提交于 2019-12-20 04:22:10
问题 When I create a database dump from Amazon RDS and then I try to import it locally, the result is ERROR 1064 (42000) at line 54 . At line 54 there is the following statement: CREATE TABLE account_emailconfirmation ( The command used for dump is: mysqldump -u user -h host.rds.amazonaws.com -p --default-character-set=utf8 --result-file=sync.sql database_name The command used for import is: mysql --user=root -p mpl -vv < sync.sql And here is the output (verbosity increased). -------------- CREATE

How can I copy a single row/record from one MySQL instance to another?

前提是你 提交于 2019-12-19 18:57:23
问题 I have two MySQL instances running with the same schema. One is in the cloud; one is on my local box. The local-box version needs a couple of test rows in its main table. Effectively I'd like to do something like a mysqldump or mysqlhotcopy of a single record on the production table, and then "restore" that record into the same table on the local instance. I don't want to copy the whole table. If there are rows on the local table, I want them left alone. I'm fine with the PK of the copied row

How can I copy a single row/record from one MySQL instance to another?

北城余情 提交于 2019-12-19 18:56:21
问题 I have two MySQL instances running with the same schema. One is in the cloud; one is on my local box. The local-box version needs a couple of test rows in its main table. Effectively I'd like to do something like a mysqldump or mysqlhotcopy of a single record on the production table, and then "restore" that record into the same table on the local instance. I don't want to copy the whole table. If there are rows on the local table, I want them left alone. I'm fine with the PK of the copied row

linux 定时备份数据库

你说的曾经没有我的故事 提交于 2019-12-19 18:33:50
说明 检查Crontab是否安装 若没有 需要先安装Crontab定时工具 安装定时工具参考(https://www.cnblogs.com/shaohuixia/p/5577738.html) 需要使用root权限 yum -y install vixie-cron yum -y install crontabs 编写备份的shell脚本 参考(https://blog.csdn.net/harris135/article/details/79663901) MySQL cd ~ mkdir sql mkdir dump cd dump touch mysqldump.sh vi mysqldump.sh // docker环境下 #!/bin/bash echo "start" docker exec 容器名称 mysqldump -u用户名 -p密码 数据库名 > ~/dump/数据库名称_$(date +%Y%m%d_%H%M%S).sql find ~/dump/ -mtime +7 -name "*.sql" -exec rm -rf {} \ echo "success" //单独执行shell脚本时 在容器名称前加上 -it //dotnet 环境下 #!/bin/bash echo "start" mysqldump -u用户名 -p密码 数据库名 > ~

mysql数据库的备份与还原

好久不见. 提交于 2019-12-19 09:43:29
备份结构 1.备份表结构 mysqldump -u root -p -d dbname table1 table2 ... > a.sql 2.备份数据库的所有表结构 mysqldumo -u root -p -d dbname > b.sql 3.备份多个数据库的所有表结构 mysqldump -u root -p -d --databases db1 db2... > c.sql 4.备份所有数据库的表结构 mysqldump -u root -p -d --all-databases > d.sql 备份结构和数据(相当于在备份结构的语法上去掉-d选项) 1.备份表结构和数据 mysqldump -u root -p dbname table1 table2 ... > a.sql 2.备份数据库的所有表结构和数据 mysqldump -u root -p dbname > b.sql 3.备份多个数据库的表结构和数据 mysqldump -u root -p --databases db1 db2 > c.sql 4.备份所有数据库的表结构和数据 mysqldump -u root -p --all-databases > d.sql 备份表数据 select ... into outfile select [列名] from table [where 语句] into