Can't connect to MySQL server on 'localhost' (10061)

Can't connect to MySQL server on 'localhost' (10061)

Postby zendic » Fri 30 Mar 2007 09:28

I am new for using this software. :oops:

MySqlConnection myConn = new MySqlConnection("User Id=root;Password=password;Host=localhost;Database=disb_db");

myConn.Open(); (The error is occur from here).

How to solve this problem, I am using trial version and i am using debug to test. choose poket pc emulator 2003. Thx for help.
zendic
 
Posts: 5
Joined: Fri 30 Mar 2007 08:47

Re: Can't connect to MySQL server on 'localhost' (10061)

Postby Serious » Fri 30 Mar 2007 09:53

zendic wrote:User Id=root;Password=password;Host=localhost;Database=disb_db
Use IP address of MySQL Server host in the connection string.
Serious
 

Can't connect to MySQL server on 'localhost' (10061)

Postby zendic » Mon 02 Apr 2007 00:29

Still same the error. If i change the host to IP address of MySql Server Can't connect to MySQL server on '127.0.0.1' (10061).
zendic
 
Posts: 5
Joined: Fri 30 Mar 2007 08:47

Re: Can't connect to MySQL server on 'localhost' (10061)

Postby zendic » Mon 02 Apr 2007 01:11

zendic wrote:Still same the error. If i change the host to IP address of MySql Server Can't connect to MySQL server on '127.0.0.1' (10061).


My Code:

try
{
MySqlConnection myConn = new MySqlConnection("User Id=root;Password=password;Host=127.0.0.1;Database=disb_db");
myConn.Open();
MySqlCommand myCommand = new MySqlCommand("select * from m_stkmst", myConn);
myCommand.Parameters.Add("?", testText.Text);
Int64 count = Convert.ToInt64(myCommand.ExecuteScalar());
Console.WriteLine(count);
myConn.Close();

}
catch
{

throw;
}
zendic
 
Posts: 5
Joined: Fri 30 Mar 2007 08:47

Postby Alexey » Mon 02 Apr 2007 07:23

Use true IP address of your host instead of 127.0.0.1.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Can't connect to MySQL server on 'localhost' (10061)

Postby zendic » Tue 03 Apr 2007 00:38

I alr set my IP to True ip = 192.168.1.107.
The error is still same...
Any solution or example, Thanks.
I want to purchase the product if it is can use in the pocket pc.....
zendic
 
Posts: 5
Joined: Fri 30 Mar 2007 08:47

Postby Alexey » Tue 03 Apr 2007 06:03

Are you able to connect in design-time?
Are you able to connect to your MySQL Server using another client?
Do you have default port number (3306)?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Help

Postby zendic » Mon 09 Apr 2007 07:04

my default is 3307,
i have use other mysql server to call it but that is no problem.
I am using coding to call it.
zendic
 
Posts: 5
Joined: Fri 30 Mar 2007 08:47

Postby Alexey » Tue 10 Apr 2007 06:50

Did you set the port number in your connection string?
Are you able to connect in design time?
I've sent you a test program (zipped and renamed to *.txt) to ngeiji at gmail dot com. Specify your host address and port number and click Ping button. If you don't get MySQL Server's version then something wrong with your server.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Alexey » Thu 19 Apr 2007 09:59

Any news? Did you run my application?
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby bwalmisley » Wed 08 Aug 2007 09:46

Hi,

I'm having EXACTLY the same problem.

Until yesterday the application was connecting fine - it now connects at design time only.

Error message is:
Cant't connect to mysql server on 'localhost' (100061)

Username and password are correct.

Using the IP address (either 127.0.0.1 or the real IP address makes no difference).

I read username and password from the user

e.g.
Code: Select all
this.mySqlConnection1.Password = serverinformation.Password.Text;
                        this.mySqlConnection1.UserId = serverinformation.Username.Text;
                       
                        this.mySqlConnection1.Host = serverinformation.ServerName.Text;
                        this.mySqlConnection1.Database = serverinformation.Database.Text;                       
                        this.mySqlConnection1.Open();



The 'design code' is this:
Code: Select all
            this.mySqlConnection1.Compress = true;
            this.mySqlConnection1.ConnectionString = "User Id=linearuser;Password=lineartest;Host=localhost;Database=masons2;Compress=T" +
                "rue;Protocol=Tcp;";
            this.mySqlConnection1.Name = "mySqlConnection1";
            this.mySqlConnection1.Owner = this;


Edit: The connection can't be timing out because its returning with the error in less than a second.

I have tried deleting the MySQLConnection object and recreating it, but the same scenario repeats.
bwalmisley
 
Posts: 2
Joined: Wed 08 Aug 2007 09:35

Postby bwalmisley » Wed 08 Aug 2007 10:18

And I've found the problem

I had edited my app.config file to try and enable JIT debugging yesterday.

So it was along these lines

Code: Select all


   somesettinghere = "1"



the variable 'somesettinghere' doesnt matter - can be anything

removing that line

Code: Select all





fixes the problem...
bwalmisley
 
Posts: 2
Joined: Wed 08 Aug 2007 09:35


Return to dotConnect for MySQL