mysqldump with “reserved keywords”

Written by Ren West on June 14th, 2004

Ran into this today. I mysqldumped a database, and tried to import it again. The import failed with a SQL error. I was pretty annoyed that MySQLs own tools were generating invalid SQL until I dug into a little more. Turns out, one of my fields was named “usage”, which is a MySQL reserved keyword. So, I used the following mysqldump syntax to get a proper export.

mysqldump –password -c –allow-keywords databasename > output.sql

 

Comments are closed.

Page optimized by WP Minify WordPress Plugin