Tag Info

New answers tagged

1

I've been having the exact same issues on my OpenVZ VPS's recently. Both running Debian 7 (official OpenVZ template), both with MySQL 5.6.23 from the Dotdeb repository. Random InnoDB corrupted tables, with the dump in the error log showing strange data that is definitely not part of any of my own databases, nor any files stored in my container. Both started ...


0

Not real sure but you could try to use the Linux version of mysqldump in a Cygwin or similar interface. It has a cleaner output file than the windows version.


1

The commandline mysql allows \! to do what you want, but you appear to be in Windows, which does not really allow for such a feature. So, No, you can't do it. For reading INSERT statements (etc) back in there is the source command. Can you turn things inside out? You can get a list of databases, or otherwise create MySQL commands, from mysql ... -e ...


1

This script creates all databases accordingly to the names of the files: PW=your password here for i in *.sql; do db=$(echo $i|sed s/.sql$//;); echo $db ...; mysql -u root -p$PW -e "create database $db"; mysql $db -u root -p$PW < $i; done


0

While a lot of answers are on the right track, none of them seem to validate that your data is actually consistent, here is what I do for databases (small or large): Ensure that the database is not being used; disable/turn off the application. This is to ensure that the dump is consistent. Dump the database using mysqldump -u <user> -p ...


0

mysqldump needs -u and -p for some mysql "user".


0

Use only mysqldump -u user -p database The -d option means no-data : --no-data, -d Do not write any table row information (that is, do not dump table contents). This is useful if you want to dump only the CREATE TABLE statement for the table (for example, to create an empty copy of the table by loading the dump file).


0

I could easily suggest changing InnoDB settings which might be a littel heavy-handed just to get a mysqldump to work. You may not like what I am about the suggest, but I believe it's your best (only) option. Here it goes: SUGGESTION #1 : Disable extended inserts The default setting for mysqldump would include clumping together hundreds or thousands of rows ...


0

Assuming RDS with MySQL 5.6 is being used, mydumper may be a better option. The newer versions have the RDS grants limitation into account and you will get all the advantages of mydumper over mysqldump (compression, parallel execution, overall faster speed, etc).


0

If you want to do this for MyISAM or mixed tables without any downtime from locking the tables, you can set up a slave database, and take your snapshots from there. Setting up the slave database, unfortunately, causes some downtime to export the live database, but once it's running, you should be able to lock it's tables, and export using the methods others ...



Top 50 recent answers are included