#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Laurens, SC ,US
    Posts
    20
    Rep 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
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    16
    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)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Laurens, SC ,US
    Posts
    20
    Rep 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
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    Laurens, SC ,US
    Posts
    20
    Rep 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".
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Location
    KL, Malaysia
    Posts
    2
    Rep 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.

Similar Threads

  1. how to create and view PNG file ?
    By hardseeker in forum Web Design Help
    Replies: 1
    Last Post: October 24th, 2002, 02:39 PM
  2. Replies: 5
    Last Post: October 17th, 2002, 11:55 AM
  3. Best way to create mysql-tables with perl?
    By Maglight in forum Perl Programming
    Replies: 6
    Last Post: September 19th, 2002, 03:48 PM
  4. create database & select_db in perl ? (DBI + MySQL)
    By silvah in forum Perl Programming
    Replies: 4
    Last Post: February 4th, 2002, 06:53 AM
  5. image create?
    By 1010101 in forum PHP Development
    Replies: 1
    Last Post: December 25th, 2001, 01:25 PM

IMN logo majestic logo threadwatch logo seochat tools logo