[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-04-21
8
Medium Priority
?
270 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:Schuyler Kuhl
  • 5
  • 3
8 Comments
 
LVL 19

Accepted Solution

by:
Greg Alexander earned 2000 total points
ID: 35444805
Click on the SQL tab and paste the database structure in there from the dump
0
 

Author Comment

by:Schuyler Kuhl
ID: 35444813
ok. So I paste entire contents of the dump file?

Thank you.
0
 
LVL 19

Expert Comment

by:Greg Alexander
ID: 35444814
Yes, or click the import tab once you are on the database and browse to the .sql file
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 19

Expert Comment

by:Greg Alexander
ID: 35444824
I prefer to just paste it in there if it is not to big
0
 

Author Comment

by:Schuyler Kuhl
ID: 35444835
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
 

Author Comment

by:Schuyler Kuhl
ID: 35444844
it worked perfectly.  Thank you very much.
0
 
LVL 19

Expert Comment

by:Greg Alexander
ID: 35444846
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
 
LVL 19

Expert Comment

by:Greg Alexander
ID: 35444848
Cool, glad to help!
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 17 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question