copy a mysql table structure from one db to another using phpmyadmin

Greetings,

I'd like to create a new table in a mysql database based on an existing table in another database. I don't want to move the data, only the structure.

Using phpMyadmin I created a dump file of the original table structure.

How to I use phpMyAdmin on the other db to create the new, empty table?

Thank you.

Sky
Schuyler KuhlAsked:
Who is Participating?
 
Greg AlexanderLead DeveloperCommented:
Click on the SQL tab and paste the database structure in there from the dump
0
 
Schuyler KuhlAuthor Commented:
ok. So I paste entire contents of the dump file?

Thank you.
0
 
Greg AlexanderLead DeveloperCommented:
Yes, or click the import tab once you are on the database and browse to the .sql file
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Greg AlexanderLead DeveloperCommented:
I prefer to just paste it in there if it is not to big
0
 
Schuyler KuhlAuthor Commented:
ok. it is not too big.  The only reason I ask is because I am looking at the sql file and it references the original database name.  So I only want to create a new table.  I'm trying it now.

thank you
0
 
Schuyler KuhlAuthor Commented:
it worked perfectly.  Thank you very much.
0
 
Greg AlexanderLead DeveloperCommented:
take out the part that has the create table statement should look like
CREATE TABLE IF NOT EXISTS `some_table` (
  `id` int(11) NOT NULL auto_increment,
  `page_name` varchar(125) NOT NULL default '',
  `body` longtext,
  `web_link` varchar(150) NOT NULL default '',
  `email` varchar(150) NOT NULL default '',
  `link_to` varchar(255) NOT NULL default '',
  `front_display` int(11) NOT NULL default '1',
  `admin_display` int(1) NOT NULL default '1',
  PRIMARY KEY  (`id`)
);

Open in new window

0
 
Greg AlexanderLead DeveloperCommented:
Cool, glad to help!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.