jetliweb Posted August 24, 2012 Posted August 24, 2012 Hi, Looks like I can not connect to the MySQL database of my account, don't know why?I use the ASP.net in C# to connect it. So far I just put the codes to connect to database to show the data,but the page shows this error " Server Error in '/' Application Unable to connect to any of the specified MySQL hosts. Description: HTTP 500. Error processing request.Stack Trace: MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.Driver.Open () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection () [0x00000] in <filename unknown>:0 at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver () [0x00000] in <filename unknown>:0 " My codes:…//use MySql databaseusing MySql.Data.MySqlClient;……protected void BTN_conMysql2_Click(object sender, EventArgs e) { string MyConString = "SERVER=localhost;" + "DATABASE=mydatabase;" + "UID=myusername;" + "PASSWORD=mypassword;"; string sql = "select * from report"; DataSet dt =new DataSet(); MySqlConnection connection = new MySqlConnection(MyConString); MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(sql, connection); adapter.Fill(dt); GridView_dataFromMysql.DataSource = dt; GridView_dataFromMysql.DataBind(); } It actually worked at the very beginning, but it doesn't recently. ?
anush Posted August 24, 2012 Posted August 24, 2012 I don't know much in C# and ASP. Check whether the General Configurations Like Host name is 'localhost ' not any other name and the user name and password are correct and the user has permission to check the DB. wait for a while till some one with ASP or C# knowledge helps you. And Welcome to Helio Net Community.
jetliweb Posted August 24, 2012 Author Posted August 24, 2012 Hi, Looks like I can not connect to the MySQL database of my account, don't know why?I use the ASP.net in C# to connect it. So far I just put the codes to connect to the database to show the data,but the page shows this error " Server Error in '/' ApplicationUnable to connect to any of the specified MySQL hosts. Description: HTTP 500. Error processing request.Stack Trace: MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts.at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in <filename unknown>:0at MySql.Data.MySqlClient.Driver.Open () [0x00000] in <filename unknown>:0at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection () [0x00000] in <filename unknown>:0at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection () [0x00000] in <filename unknown>:0at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver () [0x00000] in <filename unknown>:0 "My codes:…//use MySql databaseusing MySql.Data.MySqlClient;……protected void BTN_conMysql2_Click(object sender, EventArgs e){string MyConString = "SERVER=localhost;" +"DATABASE=mydatabase;" +"UID=myusername;" +"PASSWORD=mypassword;";string sql = "select * from report";DataSet dt =new DataSet(); MySqlConnection connection = new MySqlConnection(MyConString);MySqlDataAdapter adapter = new MySqlDataAdapter();adapter.SelectCommand = new MySqlCommand(sql, connection);adapter.Fill(dt); GridView_dataFromMysql.DataSource = dt;GridView_dataFromMysql.DataBind();} It's working on my local (I created same enviroments on my local and helio localhost).It actually worked at the very beginning, but it doesn't recently.? Should set up something else?
jetliweb Posted August 25, 2012 Author Posted August 25, 2012 Johnny was down for a while this afternoon.After it came back, my site can finally connect to MySQL.But it still kinda slow.
anush Posted August 25, 2012 Posted August 25, 2012 Use this server monitor to check the server status http://heliohost.grd.net.pl/monitor/ EDIT: That server monitor is down because Piotr GRD had a severe hardware failure.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now