Automate data grid export

sanumoli posted 2 weeks ago in Import/Export

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?

Misha v.3 posted 2 weeks ago

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 posted 2 weeks ago

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!

Misha v.3 posted 2 weeks ago
  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.