Hello,
I am using MySQL 4.0.
Say that I have a table named "mytable" having a column "ID" and a
column "test columnname".
When dumping:
mysqldump --opt DATABASE -uUSER -hHOST -pPASS > myfile.txt
it gives someting like:
CREATE TABLE mytable(ID int(11) NOT NULL, test columnname text NOT
NULL);
Then I use the mysql command to import myfile.txt in another database:
mysql DATABASE -uUSER -hHOST -pPASS < myfile.txt
but it fails with:
"ERROR 1064 at line 1: 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 'test columnname text NOT NULL)' at line 1"
Obviously, the mysql command can't handle column names with spaces. Is
this a bug? I would say so - mysqldump should put the column names
between quotes or so (alternatively, mysql shouldn't allow spaces in
column names).
My problem is that I have to work with these columns as they are.
They're also referred to from a lot of queries in the API's. Any
possible workarounds?
Thanks
Bart