Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Problem to connect to mysql via c#.

Problem to connect to mysql via c#.

Scheduled Pinned Locked Moved C#
csharphelpdatabasemysqlsysadmin
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hdv212
    wrote on last edited by
    #1

    Hi i want to connect to mysql database that exists in customer website host via client c# app (via MySqlConnector for .net), but when connection wants to open, i got this error :

    Unable to connect to any of the specified MySQL hosts.

    where is my problem and how to solve it ? here is my connection string :

    string conStr = "server=hostIPAddress;user id=userName; password=password; database=dbName;";

    thanks

    L S 2 Replies Last reply
    0
    • H hdv212

      Hi i want to connect to mysql database that exists in customer website host via client c# app (via MySqlConnector for .net), but when connection wants to open, i got this error :

      Unable to connect to any of the specified MySQL hosts.

      where is my problem and how to solve it ? here is my connection string :

      string conStr = "server=hostIPAddress;user id=userName; password=password; database=dbName;";

      thanks

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      read this : probably your mysql are listening only to localhost. http://stackoverflow.com/questions/938047/how-to-make-mysql-accept-connections-externally[^]

      1 Reply Last reply
      0
      • H hdv212

        Hi i want to connect to mysql database that exists in customer website host via client c# app (via MySqlConnector for .net), but when connection wants to open, i got this error :

        Unable to connect to any of the specified MySQL hosts.

        where is my problem and how to solve it ? here is my connection string :

        string conStr = "server=hostIPAddress;user id=userName; password=password; database=dbName;";

        thanks

        S Offline
        S Offline
        senguptaamlan
        wrote on last edited by
        #3

        go to the following link to see whether al the option in the connection string are given properly or not. http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-connection-options.html[^] also see that the Port at the hosting environment is not blocked, if blocked then register in the exception list in Windows Firewall, or any firewall setting in the host computer

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups