Automate data grid export

[expired user #11837]'s profile image [expired user #11837] posted 5 years ago in Import/Export Permalink

Hi,

In my database I have 100's of tables and I want to export each and every table to CSV files. Instead of manually going to each table and do export data grid to CSV, is there a way to automate it for all the tables in the database?

[expired user #1502]'s profile image [expired user #1502] posted 5 years ago Permalink

You do not nee heidi for this.

  1. You can use mysqldump with --fields-terminated & Co options
  2. You can create .sql file with a number of SELECT * INTO OUTFILE ... statements
ducpham's profile image ducpham posted 5 years ago Permalink

You do not nee heidi for this.

  1. You can use mysqldump with --fields-terminated & Co options
  2. You can create .sql file with a number of SELECT * INTO OUTFILE ... statements

Hi Misha could you elaborate?

The databases are stored on the server. For mysqldump command, do we SSH into the server, then run that command on the server? Then how do we get the csv files from the server to our computer?

For second option, this can be done directly from HEIDISQL into our host machine (Windows) right? Could you provide some sample scripts?

Thanks for your help!

[expired user #1502]'s profile image [expired user #1502] posted 5 years ago Permalink
  1. mysqldump could be on your PC if the server allow you do connect remotely. As a result, data would be stored on the same PC. If remote connections are not allowed, you have to SSH to server and issue the command from the server. Dump would be created on the server.

  2. The query can be issued from any client (mysql, heidi, etc) if remote connection allowed but will be executed on the server and path to file should be a valid on the server. File permissions are required.

All above described in mysql manual with examples so you should read it first.

Please login to leave a reply, or register at first.