connecting to mysql in a remote location..
-
hi guys, i been writing a program that connect to a remote database in speedhosting.co.cc .But i been having problem to connect its showing error when i run it... Error message : An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll Additional information: Unable to connect to any of the specified MySQL hosts. below is my coding :-
#pragma once
namespace trialcpp {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace MySql::Data::MySqlClient; /// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Button^ cmdLogin; private: System::Windows::Forms::Button^ cmdExit; protected: private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->cmdLogin = (gcnew System::Windows::Forms::Button());
this->cmdExit = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// cmdLogin
//
this->cmdLogin->Location = System::Drawing::Point(52, 190);
this->cmdLogin->Name = L"cmdLogin";
this->cmdLogin->Size = System::Drawing::Size(75, 23);
this->cmdLogin->TabIndex = 0;
this->cmdLogin->Text = L"Login";
this->cmdLogin-& -
hi guys, i been writing a program that connect to a remote database in speedhosting.co.cc .But i been having problem to connect its showing error when i run it... Error message : An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll Additional information: Unable to connect to any of the specified MySQL hosts. below is my coding :-
#pragma once
namespace trialcpp {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace MySql::Data::MySqlClient; /// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Button^ cmdLogin; private: System::Windows::Forms::Button^ cmdExit; protected: private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->cmdLogin = (gcnew System::Windows::Forms::Button());
this->cmdExit = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// cmdLogin
//
this->cmdLogin->Location = System::Drawing::Point(52, 190);
this->cmdLogin->Name = L"cmdLogin";
this->cmdLogin->Size = System::Drawing::Size(75, 23);
this->cmdLogin->TabIndex = 0;
this->cmdLogin->Text = L"Login";
this->cmdLogin-& -
hi guys, i been writing a program that connect to a remote database in speedhosting.co.cc .But i been having problem to connect its showing error when i run it... Error message : An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll Additional information: Unable to connect to any of the specified MySQL hosts. below is my coding :-
#pragma once
namespace trialcpp {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace MySql::Data::MySqlClient; /// <summary> /// Summary for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// </summary> public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// <summary> /// Clean up any resources being used. /// </summary> ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Button^ cmdLogin; private: System::Windows::Forms::Button^ cmdExit; protected: private: /// <summary> /// Required designer variable. /// </summary> System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->cmdLogin = (gcnew System::Windows::Forms::Button());
this->cmdExit = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// cmdLogin
//
this->cmdLogin->Location = System::Drawing::Point(52, 190);
this->cmdLogin->Name = L"cmdLogin";
this->cmdLogin->Size = System::Drawing::Size(75, 23);
this->cmdLogin->TabIndex = 0;
this->cmdLogin->Text = L"Login";
this->cmdLogin-&Thilek wrote:
Additional information: Unable to connect to any of the specified MySQL hosts.
What does the
InnerException
says? Since you haven't provided enough information about the error, consider checking the following points. 1 - Make sure no firewal is not blocking the port. 2 - Make sure port in which MySQL listenes is open and allows remote connections. I believe, it listens on port 3306 on default settings. :)Navaneeth How to use google | Ask smart questions
-
Thilek wrote:
Additional information: Unable to connect to any of the specified MySQL hosts.
What does the
InnerException
says? Since you haven't provided enough information about the error, consider checking the following points. 1 - Make sure no firewal is not blocking the port. 2 - Make sure port in which MySQL listenes is open and allows remote connections. I believe, it listens on port 3306 on default settings. :)Navaneeth How to use google | Ask smart questions
-
its using port 3306 i off my firewall. yet its showing the same error.. is there any others way i can connect to mysql using different classes or connecters..?
Thilek wrote:
is there any others way i can connect to mysql using different classes or connecters
The one from MySQL, which you have used is the correct. Here[^] you get connection strings. Make sure you are using a valid format and the server address you have provided is accessible from where you are connecting. :)
Navaneeth How to use google | Ask smart questions
-
Thilek wrote:
is there any others way i can connect to mysql using different classes or connecters
The one from MySQL, which you have used is the correct. Here[^] you get connection strings. Make sure you are using a valid format and the server address you have provided is accessible from where you are connecting. :)
Navaneeth How to use google | Ask smart questions
after i change the string value to :
MySqlConnection ^conDatabase = gcnew MySqlConnection("Server=sql304.byetcluster.com;Database='speed_2972829_worm'; Uid='username' ;Pwd='password'; Protocol=pipe; Port=3306; CharSet=UTF8");
i get this error : An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll Additional information: Reading from the stream has failed. i am confused...hmm.. can help me ya ?
-
after i change the string value to :
MySqlConnection ^conDatabase = gcnew MySqlConnection("Server=sql304.byetcluster.com;Database='speed_2972829_worm'; Uid='username' ;Pwd='password'; Protocol=pipe; Port=3306; CharSet=UTF8");
i get this error : An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll Additional information: Reading from the stream has failed. i am confused...hmm.. can help me ya ?
Thilek wrote:
Reading from the stream has failed.
Looks like it is a bug in connector. See here[^]. Not sure it got fixed :(
Navaneeth How to use google | Ask smart questions
-
Thilek wrote:
Reading from the stream has failed.
Looks like it is a bug in connector. See here[^]. Not sure it got fixed :(
Navaneeth How to use google | Ask smart questions