Problems Importing with CSV

deswamp posted 7 years ago in Import/Export
Hi All

My scenario is:

1. I've exported 1 row of the database to a CSV file using Export > Export Grid Data as CSV
2. the default export settings are

Fields Separated by ;
Fields enclosed by "
lines terminated by \r\n

3. I've attempted to import using Import > Import CSV file
4. The default import settings were used:

terminated by ;
eonclosed by "
escaped by "

However, the row in my destination db is not updated. No error is showing up in the output.

I've tried every combination I can think of but no joy. I assume I'm missing something simple.

Any suggestions?? happy

ansgar posted 7 years ago
You could update to the latest build if not already done, this will give you some warnings from the server in the lower SQL log if something went wrong.

Apart from that: which line terminator was used duing import? Be sure it's also \r\n if the export did so.
ansgar posted 7 years ago
If nothing helps, please post some lines of your CSV file here so we can analyze that.
deswamp posted 7 years ago
Wow, updating to the new version worked! There was a new import section "Method". I changed that to "Client parses file contents" and everything updated :)

Thanks very much anse!
deswamp posted 7 years ago
I have a follow up question: What I want to do now is to set up a scheduled task that will do copy over a query automatically. I've read up on EVENTS but can this work for accessing a remote MySQL db and send the data to another?

If can answer this anse, I'll buy you a beer :)
ansgar posted 7 years ago
Yes I can answer but likely the answer won't make you happy so the beer might be lost :/

However, you can use events to schedule nearly any SQL command, and the scheduler runs on the server. That surely restricts events to the same workspace as SQL commands are restricted - the server it runs on. No remote stuff possible I'm afraid.

Without knowing what you're exactly trying to do, I think you can accomplish that using
- cronjob / Windows scheduled tasks
- a batch file which calls...
- mysql.exe

Just fetch data from one server and import it on the other host with a second call to mysql.exe

Please login to leave a reply, or register at first.