Copier une table MySQL, y compris les index
-
19-09-2019 - |
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?
La solution
CREATE TABLE newtable LIKE oldtable;
INSERT newtable SELECT * FROM oldtable;
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow