Dealing with some seriously incompetent database design here. Moving an app from MS Access to mySQL and for the moment it is important to preserve table names. However the Access db creator has spaces in his table names...
I tried doing this import with soft quotes, hard quotes, backticks, and no quotes but all give
"check the manual that corresponds to your MySQL server version for the right
syntax to use near 'Citation Table' at line 1,
when using table: Chain Citation Table"
I saw that you can escape spaces in some commands eg rm Chain\ Citation\ Table.txt
but I get the same error from that.
Here is an example:
mysqlimport --host=mysql.myhost.com --user=dbuser -p \
--local --delete \
--fields-optionally-enclosed-by='|' \
--fields-terminated-by=';' \
--lines-terminated-by='\n' \
dbname "Chain Citation Table.txt"
What is the right way to handle this messed up situation? Do I have to make a holding table named SomethingWithoutSpaces and import to it and then copy across?
Thanks for any advice.
In the end my solution is to split the massive delimited file into parts and import via phpMyAdmin. If anyone knows a way to specify a table name with spaces in it for mysqlimport syntax I would appreciate their help!
// 4.19.2011 Update
Found a better way using SQL, duh.