?
Solved

Create new table in MySQL

Posted on 2012-09-05
2
Medium Priority
?
370 Views
Last Modified: 2012-09-05
Hi,

We have a MySQL database on a web server; we want to split it into an "archive" portion & a "current" portion. The name of the original table is resv. Using phpMySQL, here are the steps I tried:

(1) Selected all the rows I want to split off.

(2) Exported the result to my local (Windows 7) machine. I exported data & structure. The file is about 29MB

(3) Edited the file in notepad, replacing all resv with resva.

(4) Created a gz zip file using 7-Zip. The gz file is about 4.7 MB.

(5) Using phpMySQL, tried to upload the file into a test database; note, the table resva DOES NOT exist in the test database.

(6) It runs for about 10 minutes; then just stops with no error message or anything.

What's wrong?

(3)
0
Comment
Question by:Richard Korts
2 Comments
 
LVL 15

Accepted Solution

by:
David L. Hansen earned 2000 total points
ID: 38370462
CREATE TABLE resva LIKE resv;
INSERT resva SELECT * FROM resv;
0
 

Author Closing Comment

by:Richard Korts
ID: 38370488
You da MAN. Not only does it work but almost instantly with about 86,000 rows!!

Amazing, AND a simple solution.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
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…
Suggested Courses
Course of the Month17 days, 7 hours left to enroll

864 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