Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpMyAdmin Duplicate Table

Is there some way to get phpMyAdmin to spit out the SQL needed to duplicate the table in another DB?

I saved it when I initially made the table but I've changed it quite a bit since then. It's a pretty big table and this would really help.

like image 527
I wrestled a bear once. Avatar asked Nov 03 '12 15:11

I wrestled a bear once.


People also ask

How do I move a table from one database to another in phpMyAdmin?

To perform the corresponding operations on a database table, you should select the desired table in phpMyAdmin and click on the Operations tab. The Move table to section allows you to move the table with a new name under the current database or to move it under a different database.

How do I copy a column in phpMyAdmin?

Step 1: Install a chrome extension which is called ColumnCopy. Step 2: Enter the following command in the SQL query section in phpmyadmin, and then click go. DESCRIBE "name_of_table"; Step 3: Highlight the word 'field', and then right-click and choose ColumnCopy and then click to copy this column.


2 Answers

Yes, you can navigate to the table you want and then go to (tab) Operations > Copy table to (database.table):, which is a box on the right hand side. There you can define into which database and under what name you'd like to copy your table. After having done than you get the SQL "spat out".

As I'm not completely sure about your question, if you'd like to have the table in a dump file, you could alternatively click the tab Export, where you can get the SQL as well, or download the dump file straight away.

like image 66
Havelock Avatar answered Sep 22 '22 15:09

Havelock


You can use the Export tab to select which table to export. In the diagram below,

  • the album table is specified
  • Structure is checked
  • Data is unchecked - to not generate data with the export
  • SQL radio button is checked
  • ...
  • Click on the Go button at the bottom to have the generated SQL

enter image description here

like image 25
codingbiz Avatar answered Sep 22 '22 15:09

codingbiz