I’m doing some experiments locally that require some data from a production MySQL DB that I only have read access to. The schemas are nearly identical with the exception of the omission of one column. My goal is to write a script that I can run everyday that extracts the previous day’s data and imports it into my local table.
The part that I’m most confused about is how to download the data. I’ve seen names like mysqldump be tossed around but that seems a way to replicate the entire database. I would love to avoid using php seeing as I have no experience with it. I’ve been creating CSVs but I’m worried about having the data integrity (what if there is a comma in a field or a \n) as well as the size of the CSV (there are several hundred thousand rows per day).
No way will be faster than mysqdump, if you have hundreds of thousands rows best and easy solution will be it and mysqldump not only exports entire database, you can export just the tables you want.
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
this will export
table1andtable2fromdatabasename.Also you can use where parameter to filter results: