开发者

Unable to connect to any of the specified MySQL hosts

I work in C # through MySQL.Data.dll. Normally, all works fine, but sometimes it pops up 开发者_运维百科an error "Unable to connect to any of the specified MySQL hosts". What is this error and how to get rid of it?


You may check mysql server is working or not and you can add port number of mysql in connection string like this

    "Server = myServerAddress;
       Port = 1234;
   Database = myDataBase;
        Uid = myUsername;
        Pwd = myPassword;"


Can you connect to the MySql Host through MySql Workbench?

Using the same connection parameters in your application do you get the same error?

Have you setup the user account, access, schema and roles as required?

The standard port used for connections is 3306, you can change this via the configuration settings, on a local pc look for the 'my.ini' file in the root installation directory.


I was having a having a hard time connecting to a MySQL database on HostGator through port 3306 while debugging locally. What worked for me was to change the trust level in my local web.config from medium to full.

<system.web>
    <trust level="Full" />
</system.web>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜