开发者

MySQL Connecting string using ODBC drivers

开发者 https://www.devze.com 2023-04-01 02:25 出处:网络
I am uploading a ASP.NET website which us MySQL as database and I am not able to open a connection to database on my server.

I am uploading a ASP.NET website which us MySQL as database and I am not able to open a connection to database on my server. The website was working fine on localhost but on server it throws an exception:

The server is provided with MySQL ODBC 5.0 drivers as they say. Connection string I am using is:

connectionString="driver={MySQL ODBC 5.1 Driver};Server=(local); Database=db_name; Connection Timeout=60; uid=username;pwd=1234;"

Is this the correct way of 开发者_如何学JAVAconnecting to database?


Try this (if you havnt checked out the link):

connectionString = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;"


You can check out several connection strings for MySQL with ODBC drivers at:

www.connectionstrings.com/mysql#p31


The server is provided with MySQL ODBC 5.0 drivers as they say

You're using the 5.1 driver in your connection string - have you tried changing this to 5.0?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号