Question

I am working on a project and i got a live mysql database with more than 200 tables with millions of records.For my local setup i want to export record from each table e.g 10 records from table 'A' and 10 from table 'B'.Its not possible for me to download selective numbers of record one by one as it w'll took my whole day.But phpMyAdmin only allows me to download whole the database or just a single table at a time.Now can some thing tricky be done in this situation so that i could export selective record from all the tables at a time? Thanks in advance

No correct solution

OTHER TIPS

I don't know about phpMyAdmin, but mysqldump with --where parameter can do this

$ mysqldump --user=XXX --password=XXX --where='1 limit 10' DatabaseName > filename.sql

In general, yes, what you want is easy to accomplish, but in your specific case, I think the answer is that it's not possible to do exactly what you want.

In general, it's easy to export only a subset of results; there are in fact a couple of ways to accomplish this. First, from each table export page, you can select the number of rows to export. Secondly, from any results page (for example, just clicking the Browse button), you can select a few records by checkbox and, at the end of the results, find the "With selected:" text then click the Export button there. The problem with these methods is that they work on a table basis, and you want something that will apply to the whole database. With 200 tables, as you say in your question, this will take all day and isn't a good method. However, I think it's as close as you'll get with phpMyAdmin -- I simply don't think there's a way to do a partial export from the database level.

The solution posted by David Blacksmith seems like a reasonable alternative and the best available method. Hopefully you've had success with that technique.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top