mysqldump : MySQL's Standard Dump/Backup Utility

learn more… | top users | synonyms

1
vote
1answer
275 views

MySQL Dump all rountines except one

We want to export a large amount of tables and routines and we've do this often. Each database, table and routine should be dumped with one exception: a procedure with a specific name. So I was ...
4
votes
2answers
7k views

How to increase fast backup and restore of 500GB database using mysqldump?

There is a database A size of 500GB. Tables in database A contains both MyISAM and INNODB tables. MyISAM tables are master tables and Innodb tables are main transaction tables. Backup and restore ...
1
vote
1answer
167 views

Translating backup size to database size

I have a client who gave me a 4 gig datafile from mysqldump that I need to restore somewhere. Is there a good rule of thumb for translating the size of a backup into the size of the database once it ...
0
votes
1answer
2k views

mysql duplicate entry error 1062 when restoring backup

Sorry, I seen similar threads but I still couldn't find it addressing my issue plus, I needed some more info on this. Requirement: To create an exact replica 'db4' of an existing DB 'db3'. Procedure ...
2
votes
1answer
361 views

MySQL Dump/Import progress on Windows

I'm going to dump a considerable big datatabase (7gb) from a MySQL 5.1 instance running on Windows into a .sql script and import it into a MySQL 5.5 instance, also on Windows (another machine). I'd ...
0
votes
1answer
230 views

mysqldump, preserve update_time and modify_time attributes as listed by show table status from

Does mysqldump preserve the create_time and update_time attributes that are output by show table status from? If not, is there an option that does this? From the manual it looks like mysqldump ...
3
votes
2answers
3k views

Why max_allowed_packet is larger in mysqldump than mysqld in my.cnf?

If you look at the sample config such as /usr/share/mysql/my-large.cnf, you will find.. [mysqld] max_allowed_packet = 1M [mysqldump] max_allowed_packet = 16M What is the point? Because when you ...
1
vote
1answer
2k views

mysqldump not escaping single quotes properly

I use mysqldump to backup my mysql database. The problem is that the sql file generated by mysqldump doesn't escapes single quotes properly. Here is an example of the mysqldump generated sql script : ...
2
votes
1answer
634 views

Is there any risk associated with stopping mysqldump incomplete?

I started to backup 30GB table at wrong time and now I want to stop it because it is estimated to take 7.5hours. I used following command and options: mysqldump -u db -p user table --hex-blob | gzip> ...
2
votes
2answers
445 views

MySQL, import SQL dump with another database

I have an SQL dump of db1 that contains this line: "USE db1" If I import that file into db2 with: mysql -D db2 -uroot -p < /var/backups/db1.sql.gz Is there the risk that db1 will be overriden? ...
0
votes
1answer
310 views

Incomplete MYSQL Dumps

I am using MySQL dump to back up my MySQL Databases and I'm having trouble with a couple dumps on one box. Server Specs Windows 2008 MySQL 5.1.48-community I've tried various ...
2
votes
1answer
6k views

mysqldump: Error: 'Can't create/write to file

Can't create temporary files on /var/tmp. mysqldump: Error: 'Can't create/write to file '/var/tmp/mysql.k6NKGk/#sql_5dc_2.MAI' (Errcode: 2)' when trying to dump tablespaces On my OS. id mysql ...
3
votes
1answer
401 views

adding another table to existing MySQL replication scenario

I'm running a simple MySQL replication scenario MASTER ➙ BLACKHOLE ➙ SLAVE, replicating only a number of tables via replicate-do-table on BLACKHOLE and SLAVE. Now I would like to add several more ...
3
votes
3answers
1k views

How to change data structure in mysql using mysqldump without deleting files

Essentially what I'm trying to do is sync a production server with a sandbox server, but only the table structures and stored procedures. The procedures aren't any problem since they can be overriden, ...
4
votes
2answers
4k views

mysql.proc keeps crashing, cannot do a mysqldump?

Due to some problems with InnoDB, I'm going to dump all databases to a new server: mysqldump -E -R --all-databases | pv -b | mysql -u root -p -h new.server The dump process stopped with ...
5
votes
7answers
31k views

How to import a .sql file in MySQL?

I am trying to import a .sql file using MySQL Workbench and I get this error: ERROR 1046 (3D000) at line 28: No database selected I have first created an empty database called with the same name as ...
6
votes
1answer
3k views

How should I migrate a large MySQL database to RDS?

I've already looked into this a little bit. I realize there are similar questions on Stack Overflow, and Amazon themselves have a helpful document giving advice here: ...
1
vote
0answers
85 views

MySQL replication backup

How to take MySQL Master-Master and Master-Slave replication backup?. I have setup Master-Master replication with a separate slave for each master on Ubuntu. What happens if, I issue or schedule ...
3
votes
3answers
4k views

how to use a different tmp dir for INTO OUTFILE select with MySQL?

I am trying to dump a large table (40GB, 600,000 rows) using a SELECT ... INTO OUTFILE query. I want to use that because I want my results sorted in a particular way (so mysqldump is not good enough). ...
1
vote
1answer
170 views

Creating dump file with use command

I am taking backup of 2 tables from different schema. I need to create the "use dbname" statement at the beginning of each table. mysqldump --databases company --tables loadme --databases new_company ...
1
vote
2answers
1k views

Database table data transfer between different servers using bcp.exe and mysqldump

I have 2 servers, both are exact clones of another, one is PRODUCTION live use and the other is strictly for backend DATAENTRY. Using MSSQL on two different servers I am using the following command ...
4
votes
3answers
3k views

Mysql backup strategies?

We have a innodb mysql database so we are lost with lots of different mysql backup strategies. Some talk about mysqldump some talk about third part tools. Some of the tables we also plan to run ...
1
vote
1answer
159 views

Access denied Error in MySQL and Drupal

We are trying to deploy a Drupal application on our production server. We see this strange error Lost connection to MySQL server at ''Access denied root@ipaddres password(yes) after deploying. We ...
1
vote
1answer
155 views

How export a database based in a primary key of a table?

So, I'm trying to export all the DB structure of my MySQL db. Attached is my DB structure, I have more then this, but I want these tables only. Basically Tools relate to Factsheets and Factsheets ...
3
votes
2answers
1k views

How to copy a MySQL database which is a mixture of InnoDB and MyISAM to the same server?

Because mysqldump takes forever, we decided to just move around the files. Because the 2 databases are on the same server, a cp will be fast. The problem is, from research, MyISAM is okay with being ...
7
votes
2answers
5k views

Slow MySQL Database Import with mysqldump and USE .. SOURCE

I have about 12 tables in MySQL innoDB, one of them has 11 million records in it. I used this command to back things up: mysqldump -u [USERNAME] -p [DBNAME] | gzip > [/path_to_file/DBNAME].sql.gz ...
4
votes
1answer
1k views

What's the fastest way to replicate a MySQL database from one machine to another?

What's the fastest way to replicate a MySQL database from one machine to another? The two machines are connected via LAN. How to do it without mysqldump? If using mysqldump, is the fastest way $ ...
11
votes
2answers
28k views

Safest way to perform mysqldump on a live system with active reads and writes?

I'm not sure if this is true but I remember reading if you run the following command in linux mysqldump -u username -p database_name > backup_db.sql while reads and writes are being made to a ...
1
vote
2answers
149 views

Copying a database for testing in a safe way

For testing purposes I have to create a copy of a production MySQL database that cannot be touched. These are the steps I would follow: Create a reduced size database backup: mysqldump prodDB ...
3
votes
2answers
435 views

mysqldump fails to dump database

I m using following sql query for creating db backup mysqldump -u[username] -p[password] -h[hostname] [database] | gzip > [backup file path] This generates zipped .sql file in path specified but ...
3
votes
2answers
778 views

php/mysql database redesign and migration: changing databases to tables

I wrongly designed my application to have one database to each user. each user had 3 similar tables. I now want to have one database and 3 tables only; where i will use the database name in the old ...
4
votes
4answers
2k views

Exporting\Importing a large MySQL data without mysqldump

I'm attempting to export about 150GB of data from a database with hundreds of tables, and have found mysqldump to be very buggy. After running a simple --all-databases dump succeeds, but the import ...
2
votes
1answer
1k views

ERROR 1100 (HY000) at line 11084: Table 'search_index' was not locked with LOCK TABLES

I'm trying to import a mysqldump backup of a drupal database taken from a server running MySQL 5.0 (which will be upgraded to 5.5) onto my local machine running MySQL 5.5.23. The import fails with the ...
40
votes
3answers
17k views

How can I monitor the progress of an import of a large .sql file?

I am importing a 7 GB foobar.sql to restore a table in a local database. $ mysql -h localhost -u root 'my_data' < foobar.sql $ mysql --version /usr/local/mysql/bin/mysql Ver 14.12 Distrib ...
1
vote
1answer
4k views

Problem with View When Restoring a MySQL Backup

I have a database (InnoDB) with some tables, views and routines... Periodically I do a backup using the command line: mysqldump -u user -ppassword --routines db_name > backup.sql But I have a ...
1
vote
2answers
1k views

Restore data from remote server using “.sql” file

I have a ".SQL" file which contains data at a remote server. I could download that file to my local machine and import data in my local DB, but because of network issues, and the size of ".sql" file ...
0
votes
1answer
103 views

Mysql dump restore doing some funny stuff

I am using linux platform. I also dump the data into a file and I restore into a server and I ran this command [root@localhost /]# mysqldump -u root -p fms < /device.sql The funny part it keep ...
2
votes
1answer
1k views

How to speed up a loading data into MySQL from a zipped archive

I dumped a large database to an archive with: mysqldump --compress --max_allowed_packet=500M -h myhost mydb | gzip > /tmp/mydb.sql.gz This took about 10 minutes to run, and generated a file ...
0
votes
1answer
398 views

Mysql:Need to upload data to database, get duplicate key error - how can dup keys be ignored

I'm uploading data to a db (mysql 5.1.42) from a dump file using mysql command line and get duplicate key error. This is the format I use: /mnt/temp# mysql -u username -p -h url_of_db_master -D ...
1
vote
1answer
248 views

Mysql 5.1.X How to upload data from dump file without the partitioning commands?

I need to upload data from a dump file (large one) that includes partitioning info into a database that doesn't support partitioning. How can I tell the mysql command line to ignore the partitioning ...
4
votes
1answer
117 views

For MySQL, is there tool to dump a set of rows from one tables and all related (by foreign key) rows from all related tables?

I'm using MySQL db. I want to dump a set of rows from one table and if these rows have foriegn keys that point to rows on some other tables, I want to dump those too. Then I want to load these dumps ...
2
votes
1answer
199 views

How to change the create and use statement in a large sql file without opening it

I need a way to change the schema name which appears in create statement and use statement of mysql dump file. The goal is having the database restored with a different database name on another ...
2
votes
1answer
188 views

MySQL : Does 'bytes_sent' and 'bytes_received' include mysqldump data?

I'm trying to estimate my db traffic not including backups (mysql 5.1.41). I use show global status; to get the parameters bytes_sent and bytes_received. Questions Do these numbers include ...
1
vote
1answer
2k views

Repair with keycache in mysql runs EVERY time. Can't even log why it's happening

I have a MyISAM table w/ ~1million rows and two indexes - one's a three-column key, and the other is a spatial index for bounded SELECT statements on a separate point column. My insert statements ...
3
votes
3answers
6k views

How to convert a MySQL database to PostgreSQL?

Is there any command line tool for converting the MySQL database to PostgreSQL? I'd also like to know if there is a way to convert the database using the normal mysqldump command.
22
votes
3answers
27k views

Why does InnoDB store all databases in one file?

It was convenient that MyISAM used to store each table in a corresponding file. InnoDB has made advancements in many aspects, but I wonder why InnoDB stores all databases in one file (ibdata1 by ...
2
votes
1answer
2k views

Can I mysqldump an entire database while using where='condition' on individual tables?

I have used mysqldump to dump an entire database, However, when I want to use --where=condition", on individual tables, I have dumped individual tables mysqldump --where='condition' mydb table ...
3
votes
2answers
5k views

Can mysql restore a single table from a large mysqldump?

What is the best way to restore a single table from a large (~5GB) database mysqldump file? update: I have found solutions (posted below) using command line tools to parse the table, but is there a ...
3
votes
1answer
2k views

How do I show warnings when loading data created from mysqldump?

I've got a large .sql file with large insert into ... values ... statements. Many of these statements are generating warnings during execution. How can I get mysql to print the warnings? If it hit ...
2
votes
1answer
437 views

How can I restore a single record from a MySQL backup file?

Occasionally we have an issue where a record's previous data might get wiped while editing. We backup our database every night for issues like this, however sometimes I am not available to do a ...