tags:

views:

23

answers:

1

I want to export a table of mysql database using ssh so how can I take this one.

+1  A: 
  • Export the table to a file, using MySQLDump, PHPMyAdmin or your favorite tool.
  • Transfer the file to the host of your liking, using scp or your favorite tool.

What do you mean "export using SSH?" SSH is a protocol to securely talk to a server. SCP is a way to copy files between hosts using SSH, so I assume you mean that.

mysqldump db_name tbl_name >dumpfile
scp dumpfile 127.0.0.1:.

If you dislike mysqldump, you can always just SELECT INTO OUTFILE from your favorite MySQL client (or PHP program, or just the commandline mysql). After that you transfer the file to the other host, and run LOAD DATA INFILE to load the table. You'll have to recreate the table as well.

Konerak
actually I've not phpmyadmin there so I want to know a command which I can use through putty
Rayan
@Rayan `mysqldump` works on the command line accessed through SSH.
Pekka