MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old March 1st, 2000, 04:47 PM
ebryan ebryan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 21 ebryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #2  
Old March 2nd, 2000, 04:46 AM
Ramon Ramon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Helden,Limburg,The Netherlands
Posts: 33 Ramon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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)

Reply With Quote
  #3  
Old March 2nd, 2000, 06:20 PM
ebryan ebryan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 21 ebryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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

Reply With Quote
  #4  
Old March 5th, 2000, 11:26 AM
ebryan ebryan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 21 ebryan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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".

Reply With Quote
  #5  
Old March 5th, 2000, 11:41 PM
ScaryDog ScaryDog is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Location: KL, Malaysia
Posts: 2 ScaryDog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to ScaryDog
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Any way to create a duplicate db for testing?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway