How do you mysqldump specific tables?

Nigel

Member
Registered
Joined
Jan 16, 2017
Messages
57
Points
0
I've got a question for you experts here. How do you mysqldump specific tables?

I had found some answers in a search but they didn't seem to work.
 

eva2000

Well-known member
Registered
Joined
Jan 14, 2017
Messages
173
Points
28

Mujkanovic

Well-known member
Collaborate
Registered
Joined
Apr 24, 2016
Messages
424
Points
18
Mujkanovic
I checked both your links and codes but still can not understand how to dump any tables from my MySQL database.
Can you share a real example which I can apply on my VPS to export mysql or tables on it?
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
Hi Nigel,

Try this to export an individual table

Code:
 mysqldump -u mysqlusername -p databasename table_name > tablebackup.sql
 

Nigel

Member
Registered
Joined
Jan 16, 2017
Messages
57
Points
0
Thanks for the replies guys. I'll try these two possibilities out and see if they work.
 

Dr. McKay

Well-known member
Registered
Joined
Nov 26, 2016
Messages
565
Points
28
checked official mysql docs https://dev.mysql.com/doc/refman/5.6/en/mysqldump.html ? ;)

Code:
shell> mysqldump [options] db_name [tbl_name ...]
shell> mysqldump [options] --databases db_name ...
shell> mysqldump [options] --all-databases
Hi Nigel,

Try this to export an individual table

Code:
 mysqldump -u mysqlusername -p databasename table_name > tablebackup.sql
I am wondering there is a difference between this way with clicking on the tables on PHPmyadmin and export them?
or using mysqldump is faster?
 

HostingWaves

Member
Registered
Joined
Jan 16, 2017
Messages
53
Points
0
phpMyAdmin is also easy to take backup of specific table, but the backup file will be saved on local machine.

If you use below command to take backup of mysql table, the tablename.sql file will be generated on server itself and you can easily restore it too.

mysqldump -uuser -ppassword databasename tablename > tablename.sql
 

Nigel

Member
Registered
Joined
Jan 16, 2017
Messages
57
Points
0
Nigel
Thanks for the information. I got busy doing other things and haven't had a chance to try any of the methods everyone posted. I'll try them out this weekend.

I appreciate the help. :D
 
Older Threads
Replies
13
Views
8,956
Replies
1
Views
2,043

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top