paul bennett

mysqldump to text file

Posted on: August 4, 2008

Seeing as this is a bit of a pain to find, the correct syntax for exporting data and tables from a database is:

mysqldump -u username -p [database name] [table name] > [filename]

mysqldump will then ask you for your password and will then create the output file for you in the location your specify.

Note that mysqldump puts the file into the folder you’re executing from unless you specify otherwise.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives

%d bloggers like this: