Problem Description
How do I copy or clone or duplicate the data, structure, and indices of a MySQL table to a new one?
This is what I've found so far.
This will copy the data and the structure, but not the indices:
```sql
create table {new_table} select * from {old_table};
```
This will copy the structure and indices, but not the data:
```sql
create table {new_table} like {old_table};
```
AI-Generated Solution
Powered by LMSouq AI · GPT-4.1-mini
Analyzing problem and generating solution…
Was this solution helpful?