Solved

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

Posted on 2009-06-29
3
434 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

11 Experts available now in Live!

Get 1:1 Help Now