+ Reply to Thread
Results 1 to 3 of 3

Thread: MySQL Connection refused / Mono

  1. #1
    wookiezuechter is offline x10Hosting Member wookiezuechter is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    3

    MySQL Connection refused / Mono

    Hi,
    i 'm trying to establish a connection from my asp.net website to the mysql database. on my local machine everything works fine. but when i publish the webiste i get the following message when i connect to the database

    System.Net.Sockets.SocketException: Connection refused
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remote_end) [0x00000]
    at System.Net.Sockets.Socket+Worker.Connect () [0x00000]

    Here is my connectionstring:
    <connectionStrings>
    <add
    name="MySqlConnectionstring"
    connectionString="Server=127.0.0.1;Port=3306;Datab ase=wookie86_Wookiepage;Uid=wookie86_wookie;Pwd=XX XX;">
    </connectionStrings>

    I'm using mono and connect to the sqldatabase with the mysqlconnector:

    MySqlConnection conn = new MySqlConnection(connString.ConnectionString);
    MySqlCommand command = new MySqlCommand("SELECT * FROM User_st", conn);
    MySqlDataAdapter da = new MySqlDataAdapter(command);
    DataTable table = new DataTable();
    conn.Open();
    da.Fill(table);

    Any ideas how to connecto to the mysql database?
    thx
    Mike

  2. #2
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: MySQL Connection refused / Mono

    There's an extra space in the word "database" in your connection string. Probably just a type here and not in your code. Did you try "localhost" as the server instead of "127.0.0.1" ? Probably not the problem, but mono has some very strange tendencies.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  3. #3
    wookiezuechter is offline x10Hosting Member wookiezuechter is an unknown quantity at this point
    Join Date
    Jun 2009
    Posts
    3

    Re: MySQL Connection refused / Mono

    Yes the blank is just a mistake here. I've also tried "localhost" but it hasn't changed anything :dunno:
    mike

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  3. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  4. Replies: 9
    Last Post: 01-10-2008, 03:16 AM
  5. WP mysql error : Error establishing a database connection
    By orangpelupa in forum Free Hosting
    Replies: 2
    Last Post: 12-19-2007, 05:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers