Saturday, May 27, 2017 07:07 pm EDT

MySQL Export/Import Command Line Syntax

Bri's picture

If you are like me, occasionally you find yourself working with a database that is so large it's pretty much impossible to do any importing/exporting with the GUI tools. It doesn't happen often enough for myself to have the MySQL commands memorized, so I'm putting them here so I can find them again later.

Exporting using mysqldump

mysqldump –u mysqlUser -p DatabaseName TableName > FilenameToSaveAs 

Importing the same file

mysql –u mysqlUser -p DatabaseName < FilenameToImport 

Examples using Gzip and Gunzip

This example shows dumping the indicators table from the midwest-import database into a Gzipped file called indicators.sql.gz and then importing it back in to a database called midwestfish. Both are using the root mysql user.

mysqldump -u root -p  midwest-import indicators | gzip > indicators.sql.gz

gunzip < indicators.sql.gz | mysql -u root -p midwestfish

Comments

Anonymous's picture

Such a variety of student are

Such a variety of student are so near completing a paper as far as what number of words or pages they need to keep in touch with get the base limit. More often than not as you statistics out how to write an essay you are encouraged to start your essay with some kind of a trick to take the reader’s consideration. At that point, after you have done that, as you figure out how to write an essay you are advised to show your statement, which is your fundamental point. This theory can be set toward the first's end paragraph or, if your presentation takes two sections, then it must to show up some place inside of those two passages. Amount will never succeed quality in according to any instructor. It is constantly better to write a short however brilliant paper than one that is long on the grounds that it has been loaded with lessen and rubbish. I can suggest this site for your future writing works.