Google Answers Logo
View Question
 
Q: mysql database question ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: mysql database question
Category: Computers > Internet
Asked by: stonemens-ga
List Price: $50.00
Posted: 18 Dec 2003 16:56 PST
Expires: 17 Jan 2004 16:56 PST
Question ID: 288523
Greetings,

I have an existing mysql database which can be controlled through
phpmyadmin.  Using phpmyadmin, I?d like to copy the mysql database
structure (no content), and transfer it to another domain under a new
database name, and new user name.

I know how to create the new name and user for the database, but I
don?t know how to transfer the copied structure to it.

I?d like a 1, 2, 3, etc. step description on how copy the structure
and transfer it.

The database resides on a Linux server.

I am using an iMac with OS 10.2.8.

Thanks for your help.
Answer  
Subject: Re: mysql database question
Answered By: endo-ga on 18 Dec 2003 19:53 PST
Rated:4 out of 5 stars
 
Hi,

Thank you for your question.

I'm assuming you'll be using phpMyAdmin to recreate the database.

I've tried this with phpMyAdmin 2.2.3, I hope it works for you as well.

Here are the steps for you:

1-) Login with phpMyAdmin into the database you want to copy.

2-) Click on the name of the database on the left. Just under home at
the top left of the screen.

3-) You should now see a list of tables with several actions linked to
them. If you scroll down a little bit, there should be a scrolling
window that says: "View dump (schema) of database". Please select all
the tables of which you want to copy the structures. You can use the
"ctrl" key and the left mouse button to select them one at a time and
add them all. Or you can use the arrow keys and the shift button.

4-) When you're happy with your selection, make sure that the radio
button "structure only" is selected. Then press on the "Go" button
directly underneath. You might want to check the button "Save as file"
if you want to keep a copy on your machine, this will also make things
easier later.

5-) If you press save as file, you should now have a databasename.sql
file on your disk drive. You can open this with a text editor, you
should see a list of SQL commands. If you did not choose to save a
file, then you should be presented with a list of SQL commands. Please
select all the text and copy it to the clipboard.

6-) To recreate the tables using the same structures. Please go to the
corresponding page on the new database with phpMyAdmin. Paste all the
commands you have obtained into the box marked "Run SQL query/queries
on database". Then press the "Go" button directly underneath. Or you
can just provide it with the text file using the "browse" button, then
press the "Go" button. If the new database isn't running phpMyAdmin,
then you want to paste these commands into the command line interface
of MySQL.


I hope this answers your question. If anything is unclear or if you
require any clarifications, please do not hesitate to ask.

Thanks.
endo
stonemens-ga rated this answer:4 out of 5 stars
Thanks for the complete answer to my question.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy