Wednesday, December 13, 2017 02:19 am EST

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

Kolkata Escorts

Beauti Queen amazing kolkata escorts agency alwyas ready for you at your doorstep. Beauti Queen provide you high profile independent girl in kolkata, escorts service in kolkata, kolkata escorts. If you are looking for the ultimate encounter in Kolkata then I am your sophisticated young Kolkata escorts that provides upscale companionship for making your night becomes true.http://www.kolkataqueen.com/

Anonymous's picture

MySQL is the famous database

MySQL is the famous database tool which we can use for making the desktop application or web application to keep a record in the database. I’m sure that essay uk commands syntax you share would be thoughtful for the beginners and through this they are able to correct their program and can run successfully.

Anonymous's picture

I would like to thank you and

I would like to thank you and http://ghostwritingerfahrungen.de/ i will certainly look forward to coordinate with you during my DBA program to better adapt to the British system and advance in this program.

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.