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


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.

Schuyler KuhlAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Greg AlexanderLead DeveloperCommented:
Click on the SQL tab and paste the database structure in there from the dump

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Schuyler KuhlAuthor Commented:
ok. So I paste entire contents of the dump file?

Thank you.
Greg AlexanderLead DeveloperCommented:
Yes, or click the import tab once you are on the database and browse to the .sql file
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Greg AlexanderLead DeveloperCommented:
I prefer to just paste it in there if it is not to big
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
Schuyler KuhlAuthor Commented:
it worked perfectly.  Thank you very much.
Greg AlexanderLead DeveloperCommented:
take out the part that has the create table statement should look like
  `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

Greg AlexanderLead DeveloperCommented:
Cool, glad to help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.