export part of table from production to local DB (MySQL)

Posted on 2009-06-29
Medium Priority
Last Modified: 2012-05-07
Hi: There!

I have an urgent question related to MySQL, I have a table in Production database. It has millions recodes since it is history table. But at this moment, I only need part of the table. I make a SQL query. How to export/dump this query result so that I could put recodes/rows into local development environment for debug?
Question by:JianJunShen
  • 2
LVL 51

Accepted Solution

Steve Bink earned 2000 total points
ID: 24742849
You will want the SELECT..INTO OUTFILE syntax:


Author Comment

ID: 24742946
Thanks a lot. How to import this generated file into local MySQL database.
LVL 51

Assisted Solution

by:Steve Bink
Steve Bink earned 2000 total points
ID: 24743178
They have one for that, too:


Be aware that there is a configuration directive (--local-infile) that affects this statement in certain contexts.


Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question