+ Start a Discussion
mkimmkim 

Dataloader to insert into MySql DB

I'm trying to use the Data Loader to extract data from SalesForce and insert it into a MySql table.  The DataLoader.jar has the drivers for oracle, so what's the best way of getting it to load in the mysql drivers?  I can manually force the drivers into the jar file, but that doesn't seem to be the best idea.  I can modify the process.bat to include the drivers in the classpath.  Is there a best practice for this? 

 

Thanks.

NBlasgenNBlasgen
I don't have a real answer for this, but all of my Google searching seems to say that there is no problem interfacing to MySQL via ODBC.  Search around a little for more examples.
start_s1start_s1
In our data migration/ integration projects we use Apatar Data Integration tool (www.apatar.com). It is free/open source and has connectors for Salesforce and MySQL among many other connectors. You just need to build your datamap, map fields and run it. You may check community forum for more examples (apatarforge.org)
Ispita_NavatarIspita_Navatar

Why don't you just export the files from Salesforce as CSV, then use the csv for generating the tables in MySQL.


Remove the CSV headers from the generated CSV file along with empty data that Excel may have put at the end of the CSV file.

You can then import it into a MySQL table by running:
load data local infile 'uniq.csv' into table tblUniq fields terminated by ',' enclosed by '"' lines terminated by '\n'
(uniqName, uniqCity, uniqComments)


The fields here are the actual tblUniq table fields that the data needs to sit in. The enclosed by and lines terminated by are optional and can help if you have columns enclosed with double-quotes such as Excel exports, etc.

Perhaps you can write a small dot net program to automate the whole process and use xml file for storing table information for the program to read from.

mkimmkim

well, we went with a different way than the data loader.  exporting as csv is fine, but, i was just trying to do the least amount of steps as possible.  also, like i mentioned, just modifying the classpath in the actual process.bat to include the drivers worked as well.  but, with that solution, each time a new version of dataloader came out, that would need to be modified each time.

 

thanks for the replies though.

Jamie MartinJamie Martin

If you want to extract your data from Salesforce and insert it into your MySql table, put in manually or use 3-rd parties application (e.g Skyvia (https://skyvia.com/)).
 

These kind of services are able to do it automatically, you don`t need to put your data into CSV. Also, you can set up automatic scheduling and keep your data always up-to-date. Moreover, services are usually no-coding and have nice UI.