Question and answer is powered by AnsPress.io
I have two database in my local server and I want to create a new table same to same another database table. In another database table, there have many columns, so I want to copy all columns and paste in a new table with a different name. How can I do it?
Open PHPMyAdmin and choose SQL then apply it.
CREATE TABLE my_database2.my_table2 SELECT * FROM my_database1.my_table2; ALTER TABLE my_database2.my_table2 ADD id INT AUTO_INCREMENT PRIMARY KEY;
Here replace your database and table name which names is exist in your localhost database.