|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
I have a small Access database that I am attempting to export to MySQL. My service provider has MySQL and PHP on the server already. I am familar with table creation etc... However, I can't seem to get the import to work properly. I keep getting parse errors. I've exported the Access databse to a text file. Then I attempt the import into MySQL and I get a error message like this:
MySQL said: parse error near 'n' ' at line 1 I'm using an automated Control panel to do the import. I've tried doing it in the shell too. Any help will be greatly appreciated. |
|
#2
|
|||
|
|||
|
My first guess is that you have pc newlines instead of unix linefeeds. Try opening the file in a text editor that will allow you the option of "Save as Unix text file" vs. "Save as PC text file." (UltraEdit is one.)
|
|
#3
|
|||
|
|||
|
There are a number of utilities on php.net that will produce a text file from Access, containing complete SQL commands to feed into the mySQL monitor. You may also be able to find an ODBC add-in the exports Access directly to mySQL.
Personally I was only using Access to read in a CSV, which I then discovered mySQL could do directly very easily. |
|
#4
|
|||
|
|||
|
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by gszczyrb:
I have a small Access database that I am attempting to export to MySQL. My service provider has MySQL and PHP on the server already. I am familar with table creation etc... However, I can't seem to get the import to work properly. I keep getting parse errors. I've exported the Access databse to a text file. Then I attempt the import into MySQL and I get a error message like this: MySQL said: parse error near 'n' ' at line 1 I'm using an automated Control panel to do the import. I've tried doing it in the shell too. Any help will be greatly appreciated. [/quote] Log into the server: $mysql -u yourname yourdbname<cr> password: ******* mysql> Use this set of code, and you will be find. load data infile "/usr2/mysql/lube/import_data/vehicle1.txt" into table vehicle fields terminated by ',' enclosed by '"' lines terminated by 'n' The file "vehicle1.txt" is a "comma-delimited file", where ALL FILES are surrounded by quotes and separated by commas. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > From MS Access to MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|