Question

Je peux copier une table MySQL pour créer une nouvelle table:

CREATE TABLE newtable SELECT * FROM oldtable

Cela fonctionne, mais les indices ne sont pas copiés dans la nouvelle table. Comment puis-je copier un tableau dont les index?

Était-ce utile?

La solution

CREATE TABLE newtable LIKE oldtable; 
INSERT newtable SELECT * FROM oldtable;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top