USING BTREE Fehler bei MySQL Import
- Erstellt:
- Samstag, 09. Juli 2011
- Letzte Bearbeitung:
- Sonntag, 10. Juli 2011
Antwort
ERROR 1064 (42000) at line 1561: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘USING BTREE, …
Schuld daran ist das veränderte SQL Syntax der Version 5.1.
Aufgrund eines fehlenden Kompatibilitätsschalters beim Export ( wie zum Beispiel mysqldump -comptability=mysql50 ) bleibt hier nur die Möglichkeit, den Dump an das 5.0 Syntax anzupassen.
Unter Linux geht dies über die Konsole:
1 |
sed -i -r 's/\(([^)]+)\) USING BTREE/USING BTREE (\1)/g' mydump.sql |
Alternativ auch im Dump die Stelle mit "USING BTREE" suchen und einfach entfernen, oder tauschen ...
mysql50 erzeugt:
UNIQUE KEY IDX_BASE USING BTREE ( entity_type_id, entity_id, attribute_id, store_id ),
mysql51 erzeugt:
UNIQUE KEY IDX_BASE( entity_type_id, entity_id, attribute_id, store_id ) USING BTREE,




Kommentar schreiben