MYSQL: dump

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
ngaisteve1
Forum Newbie
Posts: 5
Joined: Wed Apr 30, 2003 3:05 am

MYSQL: dump

Post by ngaisteve1 »

I have a table in a database name let's say A. How do I copy and paste (database structure and data) this table to another database let's say B. B already there. I know something like dump table. But, I don't really know how. I am using mysql with control centre. Thanks.
User avatar
coolpravin
Forum Newbie
Posts: 20
Joined: Mon May 19, 2003 12:56 am
Location: India

Use Phpmyadmin

Post by coolpravin »

Use Phpmyadmin
A free source script.
Create new database through it.
Select your original database.
Use export option.
and use these sql queries in new database.
Thats it :lol:
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

phpMyAdmin site ('cause coolpravin didn't give it):
http://www.phpmyadmin.net

Mac
User avatar
Wayne Herbert
Forum Commoner
Posts: 34
Joined: Tue Apr 29, 2003 3:13 pm
Location: Houston, Texas

Re: MYSQL: dump

Post by Wayne Herbert »

ngaisteve1 wrote:I have a table in a database name let's say A. How do I copy and paste (database structure and data) this table to another database let's say B. B already there. .
If you have direct access to the MySql data directories, then the process is trivially easy (although I agree with the use of phpMyAdmin... a necessity when working with a remote MySql server).

But if you are local, you will notice that the database name is simply a folder name under the data directory of MySql. For example if you have DbA and DbB, then you'll see:

/MySql/data
/DbA
/DbB

Inside DbA there will be three files with the table name you are interested in. For a table called FRAMMIS, you will see FRAMMIS.MYI, FRAMMIS.MYD, and FRAMMIS.frm. Just copy all three of these files into the /DbB directory, and presto, a new table in DbB.
ngaisteve1
Forum Newbie
Posts: 5
Joined: Wed Apr 30, 2003 3:05 am

Post by ngaisteve1 »

Thanks, Wayne Herbert. That is what I am looking for.
Post Reply