The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Databases
> MySQL Help
|
Any way to create a duplicate db for testing?
Discuss Any way to create a duplicate db for testing? in the MySQL Help forum on Dev Shed. Any way to create a duplicate db for testing? MySQL Help forum discussing administration, SQL syntax, and other MySQL-related topics. MySQL is an open-source relational database management system (RDBMS).
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

March 1st, 2000, 04:47 PM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I am changing some functions and would prefer
not to develop on the 'live' database.
Is there any way to duplicate the db and work against that while I debug?
------------------
Thanks for the help.
ebryan@lumenet.com
|

March 2nd, 2000, 04:46 AM
|
|
Contributing User
|
|
Join Date: Oct 1999
Location: Helden,Limburg,The Netherlands
Posts: 33
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
Yes, you can simply copy all the files of the database which, on win32 at least, is in the folder mysqldataDBNAME.
You just place the copy in another folder in the data-directory such as:
mysqldataDBNAMETEST
and you have an exact copy of all the tables.
Finally you only have to update the user and db tables in the mysql-database to set the same privileges for the specific users for the copy of the database.
------------------
Ramon Litjens
Boradoli Web Design
(www.boradoli.nl)
|

March 2nd, 2000, 06:20 PM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Ramon:
Yes, you can simply copy all the files of the database which, on win32 at least, is in the folder mysqldataDBNAME.
You just place the copy in another folder in the data-directory such as:
mysqldataDBNAMETEST
and you have an exact copy of all the tables.
Finally you only have to update the user and db tables in the mysql-database to set the same privileges for the specific users for the copy of the database.
[/quote]
Sorry, I should have mentioned this in my message. The first thing I tried was using the Unix cp command to copy the ISD,FRM and ISM files over to a new directory called 'test'. The database appears in mysql and the tables are there and I can use things like 'describe tables' but I can't select or add new rows, or even delete the existing ones, without an error - "Got error 134 from table handler".
Hmmm, what next kemosabe?
Yours, Tonto...
------------------
Thanks for the help.
ebryan@lumenet.com
|

March 5th, 2000, 11:26 AM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
In case anyone else reads this I thought I should add that I accidentally found the solution. I had to restart the Apache server and, of course, mysql needed to be restarted. When it came up, all the tables are accessible. In other words, no more Error 134 Table Handler or whatever it was. Apparently by restarting the mysql server the tables were rebuilt and now I have that wonderful duplicate database for testing without having to recreate all the tables (of which there are too many for this to be fun). Voila! There is truth to the old saying "Even a blind chipmunk finds a nut every now and then".
|

March 5th, 2000, 11:41 PM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: KL, Malaysia
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I use phpMyAdmin,
It is very easy using this to copy a database.
First do a dump of your current database, this will provide a text file that when pasted into the SQL query field will create all your tables (and data if needed)
Second create a new database (named test or whatever) then use the run sql query text box(paste the previous dump in).
I know this sounds complicated =) but really it only takes a second.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|