SOFARI HASSANE

SOFARI HASSANE

  • NA
  • 237
  • 20.5k

Connection problem with mysql database

Aug 27 2019 5:02 AM
 Hi everyone!
 
I encounter this error when I try to connect to the mysql database, here is the data of my connection. can someone help me to see more clearly?
here is the error message:
  1. MySql.Data.MySqlClient.MySqlException  
  2.   HResult = 0x80004005  
  3.   Message = Unable to connect to any of the specified MySQL hosts.  
  4.   Source = MySql.Data  
  5.   Procedure tree:  
  6.    at MySql.Data.MySqlClient.NativeDriver.Open ()  
  7.    at MySql.Data.MySqlClient.Driver.Open ()  
  8.    at MySql.Data.MySqlClient.Driver.Create (MySqlConnectionStringBuilder settings)  
  9.    at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection ()  
  10.    at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection ()  
  11.    at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver ()  
  12.    at MySql.Data.MySqlClient.MySqlPool.GetConnection ()  
  13.    at MySql.Data.MySqlClient.MySqlConnection.Open ()  
  14.    at DeviseExchange.login.button1_Click (Object sender, EventArgs) in C: \ Users \ HP \ source \ repos \ CurrencyExchange \ CurrencyExchange \ login.cs: line 91  
  15.    at System.Windows.Forms.Control.OnClick (EventArgs e)  
  16.    at System.Windows.Forms.Button.OnClick (EventArgs e)  
  17.    at System.Windows.Forms.Button.OnMouseUp (MouseEventArgs mevent)  
  18.    at System.Windows.Forms.Control.WmMouseUp (Message & m, MouseButtons button, Int32 clicks)  
  19.    at System.Windows.Forms.Control.WndProc (Message & m)  
  20.    at System.Windows.Forms.ButtonBase.WndProc (Message & m)  
  21.    at System.Windows.Forms.Button.WndProc (Message & m)  
  22.    at System.Windows.Forms.NativeWindow.DebuggableCallback (IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)  
  23.    at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW (MSG & msg)  
  24.    at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop (IntPtr dwComponentID, Int32 Reason, Int32 pvLoopData)  
  25.    at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner (Int32 reason, ApplicationContext context)  
  26.    at System.Windows.Forms.Application.ThreadContext.RunMessageLoop (Int32 reason, ApplicationContext context)  
  27.    at DeviseExchange.Program.Main () in C: \ Users \ HP \ source \ repos \ CurrencyExchange \ CurrencyExchange \ Program.cs: line 19  
  28.   
  29. Internal exception 1:
  30. MySqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
and my connection class:
  1. namespace DeviseExchange  
  2. {  
  3. class connexion  
  4. {  
  5. public static string getconnexion() {  
  6. return "Server= 91.216.107.162;Database=afasi717346;uid =afasi717346;Password=zv63XCDH";  
  7. }  
  8. }

Answers (2)