Forum Moderators: phranque
I tried exporting to an excel file, but phpMyAdmin creates errors when I try to import the file.
any thoughts, experience or ideas to help me out greatly GREATLY appreciated!
:)
MySQL said:
#1064 - 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
I will try the dts! New learning experience, thanks!
right syntax to use near
Did that come through correctly -- it just "trails off"?
It could be your CSV files have Windows-style CRLF line endings, and the Linux is expecting Unix-style LF. So MySQL chokes on the unexpected whitespace character and gives you that "invisible" error message.
You can specify an LF line ending in Enterprise manager, or do like gergoe said and use ODBC to import directly, skipping the text file.
Migrating from Microsoft SQL Server and Access to MySQL [dev.mysql.com]
MySQL said:#1064 - 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
No, I snipped that bit before it went into the specific line that was generating the errors. I think it deffinately has to do with
Windows-style CRLF line endings, and the Linux is expecting Unix-style LF
Is there a way to format the text file to replace the CRLF with LF style line endings? I haven't been successful in using ODBC to do a direct transfer. Totally new to all this, so thank you all for helping me out!
If you're transferring to mySQL because you think it's "better", I would stick with Microsoft. I know you said you wanted to move it to your Linux server, but if this is for production I strongly recommend keeping it on Microsoft. I can go on and on about the advantages of MS over MY, but only if you want to hear them. Of course, if you're moving for another reason or it's just something to tinker with, then carry on :)
I'd try installing a mySQL ODBC driver on the Windows server and connecting directly to it from your Linux box.
Another issue I run into often when migrating data like this is escaped (or non-escaped) characters in the data. Also, if you are working with a large data set, try chunking it into manageable rows to determine where the data issue lies. If you can't get past record number 1 or 2, you are more than likely dealing with a LF/CRLF issue.
Common misconceptions/misunderstandings regarding MySQL:
stored procedures [dev.mysql.com]
linked servers, clustering capabilities [mysql.com]
better performance [dev.mysql.com] for large (100GB - 2 TB) databases, etc. [dev.mysql.com]
Is there a way to format the text file to replace the CRLF with LF style line endings?
You could download jEdit to save your files with the desired line ending. Being a Mac guy (gasp!) I don't know much about Windows text editors.
If you can just re-export the text files, Enterprise manager lets you select the line endings (if memory serves, it's listed under "Record Separator").
Maybe easiest of all would be to download a MySQL front end e.g., Navicat, which makes importing files with CRLF simple. (Though, in the long run, you might be happier getting Enterprise Manager connected to MySQL.)
[dev.mysql.com...]
and
[modwest.com...]
Now I need to build a custom search to use all this data (that will be a different thread though)
:-)