Solved

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

Posted on 2009-06-29
3
435 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Display multiple images in the row in PHP 11 78
updating the date data 12 25
How to count in a table in php 22 19
category table 2 11
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Creating and Managing Databases with phpMyAdmin in cPanel.
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.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

21 Experts available now in Live!

Get 1:1 Help Now