Solved

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

Posted on 2009-06-29
3
437 Views
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?
0
Comment
Question by:JianJunShen
  • 2
3 Comments
 
LVL 50

Accepted Solution

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

http://dev.mysql.com/doc/refman/5.0/en/select.html#id4313597
0
 

Author Comment

by:JianJunShen
ID: 24742946
Thanks a lot. How to import this generated file into local MySQL database.
0
 
LVL 50

Assisted Solution

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

http://dev.mysql.com/doc/refman/5.0/en/load-data.html

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

http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option_mysql_local-infile
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now