|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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) |
|
#3
|
|||
|
|||
|
<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 |
|
#4
|
|||
|
|||
|
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".
|
|
#5
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Any way to create a duplicate db for testing? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|