Connecting to MySQL

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
bhagerty
Posts: 28
Last visit: Fri Aug 02, 2013 11:54 am

Connecting to MySQL

Post by bhagerty »

Can some one provide a guide/how-to for connecting to a MySQL database?
User avatar
Ferdinand Rios
Posts: 373
Last visit: Fri Sep 16, 2022 1:24 pm

Connecting to MySQL

Post by Ferdinand Rios »

You will need to install a MySQL OLEDB connector. You should be able to find that on the MySQL web site.

Once that is installed, create a new connection.

Select the MySQL OleDB connector. Give it the Data Source, user name, password and create the connection.
F.G. Rios
User avatar
mwilson3
Posts: 47
Last visit: Fri Nov 23, 2012 7:23 am

Connecting to MySQL

Post by mwilson3 »

Okay, so I installed the OLE DB connector & everything is working great in PrimalSQL now.HOWEVER, when I click on Generate Script --> Powershell Script File, and run the resulting script file, I get the following error in PoSh:Exception setting "ConnectionString": "The .Net Framework Data Provider for OLEDB (System.Data.OleDb) does not supportthe Microsoft OLE DB Provider for ODBC Drivers (MSDASQL). Use the .Net Framework Data Provider for ODBC (System.Data.Odbc)."At line:1 char:15+ $DBConnection.C <<<< onnectionString = 'Provider=MSDASQL.1;Persist Security Info=False;Data Source=TETON-ATC'So.... it looks like PoSh requires that I use the .NET Connector instead of OLE.Thoughts? I am about to try to manually replace those connection lines with the relevant .NET versions and cross my fingers, but am I going to have to do this each time I want to generate a script?Thanks,Matt
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

Connecting to MySQL

Post by jhicks »

The dev team will have to look into this deeper, but in the mean time you should be able to modify your generated script, if you haven't already. You probably have a line like this:$DBConnection = New-Object System.Data.OleDb.OledbConnectionchange it to:$DBConnection = New-Object System.Data.ODBC.ODBCConnectionAlso change:$Cmd = New-Object System.Data.OleDb.OleDbCommandto:$Cmd = New-Object System.Data.ODBC.ODBCCommand
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.