עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

MySql-connect

Featured Replies

פורסם

הי,

התקנתי את ה MYSQL CONNECTOR ל NET. גרסא 5.

אני לא מצליח להתחבר לשרת, אני מקבל EXCEPTION בקריאה לפונקציה ()connection.Open

Code:

MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.Exception: Exception of type 'System.Exception' was thrown.

at MySql.Data.MySqlClient.NativeDriver.Open()

MYSQL יושב ב VIRTUAL MACHINE בלינוקס.

כתובת ה IP נכונה, USER, PASSWORD ושם ה DATABASE. וקיימת טבלה בשם ACCOUNTS.

הנה הקטע קוד:

Code:

string MyConString = "SERVER=192.168.197.200;" +

"DATABASE=test;" +

"UID=root;" +

"PASSWORD=12345;";

MySqlConnection connection = new MySqlConnection(MyConString);

MySqlCommand command = connection.CreateCommand();

MySqlDataReader Reader;

command.CommandText = "select * from accounts";

connection.Open();

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();

את התכנית ב C# אני לא מריץ על המכונה הוירטואלית, אני מריץ על מחשב נפרד WINDOWS

אשמח אם תכוונו אותי .

תודה מראש

פורסם

תנסה

telnet 192.168.197.200:3306

או

telnet 192.168.197.200 3306

תלוי איפה אתה מריץ telnet..

האם המכונה עונה ?

אם לא תנסה להריץ telnet על המכונה הוירטואלית, תראה אם הפורט הזה פתוח בכלל.

אם כן, אז יש בעיה אחרת ונמשיך לחשוב.

פורסם
  • מחבר

תודה רבה!

עזרת לי מאוד..

כשמתחברים מרחוק ל MYSQL סרבר , ברירת המחדל היא שהפורט 3306 (הפורט שMYSQL משתמש בו) סגור.

אז פתחתי אותו ועכשיו אני יכול להתחבר מרחוק.

תודה רבה על העזרה, חבר. :)

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.