Announcement

Collapse
No announcement yet.

MySQL question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL question

    I have accidently setup two MySQL databases with the same name They are working fine, but I guess this is still a bad idea.

    Using phpMyAdmin, I can see the tables so I guess it would be too difficult to export the database, split and rename, then upload.

    Any views on how to do this??? I'd rather not have to start again from scratch
    The Welsh support two teams when it comes to rugby. Wales of course, and anyone else playing England

  • #2
    Which version of MySQL do you have? in older ones you can select one of the tables, then scroll down and rename it.

    In newer ones select the table, klick "operations" at the top of the right window and rename the table there.

    (Don't know exactly if the button is named "operations" in the english version, but i think you're able to get to it


    Rakido
    Last edited by Rakido; 8 December 2004, 06:10.
    "Women don't want to hear a man's opinion, they just want to hear their opinion in a deeper voice."

    Comment


    • #3
      I would recommend backing up the DB (takes on a minute in phpMyAdmin) and then dropping one of the DBs - preferably the one not being used. And if you drop the wrong DB, you can restor ehte backup and drop the other one.

      btw, drop is the SQL command to delete a DB, just in case you're not a big DB guy.

      To backup:

      1) get in to your phpMyAdmin site.
      2) In the homepage, in the MySQL column, select Export.
      3) Select the DBs you want backed up, check "Add DROP database", "Add 'drop table'", "Save as File," and click the Go button.

      To drop a DB:
      1) Click on the DB in the left frame.
      2) Select the SQL tab in the right frame.
      3) In the "Run SQL query/queries on database..." box enter:

      DROP DATABASE <name of DB>;

      ...and then click yee Go button.
      4) Say bye-bye to your DB.

      If you deleted the wrong DB - you should be able to tell which is active and which is not by the contents of the DBs (the active one will have your coppermine/phpBB info in it, the other should be empty) - and need to restore the DBs:

      1) Click the "Query Window" link in the left column.
      2) Select the "Import files" tab.
      3) Choose the backup file from your local machine.
      4) Click Go.

      That should do it.

      Jammrock
      “Inside every sane person there’s a madman struggling to get out”
      –The Light Fantastic, Terry Pratchett

      Comment

      Working...
      X