Ich möchte eine Tabelle in MySQL kopieren. Was ist der schnellste Weg? So was?
CREATE TABLE copy LIKE original;
INSERT INTO copy SELECT * FROM original;
oder
CREATE TABLE copy SELECT * FROM original;
ALTER TABLE copy ADD PRIMARY KEY (id);
oder gibt es einen anderen weg
EDIT: Ich mache mir Sorgen, dass die Indizes neu erstellt werden. Wie geht MySQL vor, um diese Anweisungen auszuführen?
PS. kann keine Kommandozeilen-Tools wie mysqldump verwenden, muss on-the-fly sein.