MySQL Connection refused / Mono

wookiezuechter

New Member
Messages
3
Reaction score
0
Points
0
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;Database=wookie86_Wookiepage;Uid=wookie86_wookie;Pwd=XXXX;">
</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
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
252
Points
63
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.
 

wookiezuechter

New Member
Messages
3
Reaction score
0
Points
0
Yes the blank is just a mistake here. I've also tried "localhost" but it hasn't changed anything :dunno:
mike
 
Top