MySQL Connection refused

Discussion in 'Databases' started by Kasaven, Aug 1, 2012.

  1. Hi,
    I am getting an error that I don't know how to resolve. Can someone help me out: -


    Exception has been thrown by the target of an invocation.MySql.Data.MySqlClient.MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts. ---> System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it 127.0.0.1:3306 at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at MySql.Data.Common.StreamCreator.CreateSocketStream(IPAddress ip, Boolean unix) at MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.NativeDriver.Open() at MySql.Data.MySqlClient.Driver.Open() at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() at MySql.Data.MySqlClient.MySqlPool.GetConnection() at MySql.Data.MySqlClient.MySqlConnection.Open() at Portal.Data.DbFactory.Open() at

    ..........................
     
  2. Elshadriel

    Elshadriel Winhost Staff

    It looks like you may be connecting to the web server and not the database server. You need to specify the MySQL host.
     
  3. ComputerMan

    ComputerMan Winhost Staff

    Just based off the error message "127.0.0.1". It looks like you are trying to connect to the localhost of the web server. The MySQL database that we provide to our customers are hosted on a different web server.

    Log in to the Winhost control panel. Click on on the "Sites" tab at the top. Or simply click here: https://cp.Winhost.com/sites/

    Click on "Manage" next to the site you wish to manage.

    Click on the "MySQL" Icon.

    Then Click on "Manage" next to the MySQL database you are using.

    Notice the "Database Server:" field. This is the host you should be connecting to.

    For example: MySQL database is hosted on My03 Server. So my host name for my MySQL database is: my03.Winhost.com

    You might also find our knowledge base article helpful: How to connect to MySQL with PHP
     
    Last edited by a moderator: Oct 14, 2015

Share This Page