MySQL Provider not registered

S

Steven Blair

Hi,

Trying to make a connection and getting the following error:

"The 'MySQLProv' provider is not registered on the local machine."

MySQl is installed and working, I also went to ODBC settings and created a
new System Data Source for MySQl. (MySQL ODBC 3.51 Driver)

Is it my responsibilty to set the provider name, or is this held somewhere
on the system ?
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hi,

I am not a MySQL expert, but you might be using OLEDB provider for MySQL,
not an ODBC one. If this is the case, ensure the OLEDB provider for MySQL is
installed properly.


If you could post your connection string (without username and password, of
course) and code that establishes the connection, it would be easier to
pinpoint the possible reason of the error.
 
A

Austin Ehlers

Hi,

Trying to make a connection and getting the following error:

"The 'MySQLProv' provider is not registered on the local machine."

MySQl is installed and working, I also went to ODBC settings and created a
new System Data Source for MySQl. (MySQL ODBC 3.51 Driver)

Is it my responsibilty to set the provider name, or is this held somewhere
on the system ?

For your connection string, just use the dsn name for it. ie:
OdbcConnection myConn=new OdbcConnection("DSN=myDSNname");

Austin
 
S

Steven Blair

Here is what I am doing:

string source = "Provider=MySQLProv;" +

"Data Source=mySQLDB;" +

"User Id=myUsername;" +

"Password=myPassword";

conn.Open();
 
A

Austin Ehlers

Here is what I am doing:

string source = "Provider=MySQLProv;" +

"Data Source=mySQLDB;" +

"User Id=myUsername;" +

"Password=myPassword";

conn.Open();

No need for that. Just set up an Odbc User DataSource. Control Panel
Administrative Tools > Data Sources. Click Add. Select MySQL ODBC
3.51 Driver and click Finish. For the Data Source Name, pick
something that describes the actual database (say "MyFirstDB"). Be
sure to click "Test Data Source" to make sure all of your Parameters
are correct. Then, in your code, all you need is just:

OdbcConnection myConn=new OdbcConnection("DSN=MyFirstDB");
myConn.Open();

Austin
 
S

Steven Blair

Yes working now using OdbcConnection object.

This originally didnt work, but done a little investigation and realised I
need to install ODBC.net.
So, downloaded, instalkled, and added a reference and Open works fine :)

Thanx for the help, much appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top