Jump to content
PirateClub.hu

Mysql c# csatlakozás


mysterio
 Share

Recommended Posts

Sziasztok!

 

Visual studio 2010 ultimate-en dolgozok és akárhányszor kapcsolódni szeretnék az atw adatbázisához ezt a hibaüzenetet kapom vissza (127.0.0.1):

 

Access denied for user 'felhaszn'@'localhost' (using password: YES)

 

avagy (88.151.96.4):

Unable to connect to any of the specified MySQL hosts.

 

a kód amit használok :

string MyConString = "SERVER=88.151.96.4;Port=3306;DATABASE=felhasznnev;UID=felhasznnev;PASSWORD=

jelszo;";

MySqlConnection connection = new MySqlConnection(MyConString);

MySqlCommand command = connection.CreateCommand();

 

command.CommandText = "select * from users";

connection.Open();

 

MySqlDataReader Reader = command.ExecuteReader();

 

while (Reader.Read())

{

string thisrow = "";

for (int i = 0; i < Reader.FieldCount; i++)

thisrow += Reader.GetValue(i).ToString() + ",";

listBox1.Items.Add(thisrow);

}

connection.Close();

 

a server résznél próbálkoztam úgy is hogy a portot közvetlenül a szerverhez írom pl így : 127.0.0.1:3308 ez se volt hajlandó csatlakozni.

 

elõre is köszönöm a segtséget!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...