Problem connecting with sockets to MySQL

2003-05-29 Thread Jose Miguel Pérez
Hi all!

I have asked this before, but no replys. I'll rewrite the question
because I don't know if I got understood. ;-) Anyway, I have not found a
MySQL list best suited for this question, so here I go...

¿Anyone knows why the server (mysqld) behaves differently to clients
connecting from the same remote machine?
(Server 3.23.41 on a RedHat 7.2. The client is Windows XP Professional.)

In other words, say we are connecting from Host B to Server A. Well, I
will list the possible responses I'm getting (remember, always speaking of
low level socket connections).

- telnet servera 3306-- Response OK. (First handshake
packet received OK).
- MySQLFront -- Response OK. (MySQLFront connects
OK).
- mysql -u user -h servera   -- Response OK. (MySQL client connects
OK).
- nc servera 3306-- Response OK. (First handshake
packet received OK).

OK, at this point, you do think all is ok, don't you? not quite...

- Connecting via a simple TCP socket coded in Borland C++ Builder
5.0:
  The first packet response is:  1130: Host 'hostb' isn't allowed
to connect to this mysql server.
  I am not even allowed to reply with the packet that identifies my
to the server.

  Pardon? What?? I'm not ALLOWED to connect to the server?

As you can see, this is nonsense because I CAN connect to the server as
seen above. I have not come to a conclusion on this topic, so all you can
help is greatly appreciated.

I go so far as to capture the packets with a packet sniffer (ethereal),
and I got crazy: Everything seems fine, all connections generate the same
packets, in the same order... But when connecting from my program, I get
that 1130 error.

Cheers,
Jose Miguel.

PS: Yes, I have done a mysqladmin flush-hosts everytime.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Problem connecting with sockets to MySQL

2003-05-29 Thread Nils Valentin
Hi Jose,

I believe you miss an important point. Error 1130 means that the host (ip 
address) is not allowed to connect, it doesnt mean that its not physically 
possible. You have to check the privileges you gave the user or host that 
doesnt work.

login to mysql from a working account.

do this:

USE mysql
SHOW GRANTS FOR xxxuserxxx;

loook exactly what it says. 
If you are used to mysqlcc than connect from there look at the data in  all 
tables of the mysql database. They contain the privilege of each user or 
host.
there should be 5 tables f.e.

mysql.user
mysql.host
mysql.columns_priv
mysql.tables_priv
mysql.db

You will see that the rights for the host will not be set correctly, most 
likely in the mysql.host or mysql.user table.

Take a GOOD read in the manual, have a rest and then troubleshoot it.

Good Luck !!

Best regards

Nils Valentin
Tokyo/Japan






 


2003 5 29  18:47Jose Miguel Prez :
 Hi all!

 I have asked this before, but no replys. I'll rewrite the question
 because I don't know if I got understood. ;-) Anyway, I have not found a
 MySQL list best suited for this question, so here I go...

 Anyone knows why the server (mysqld) behaves differently to clients
 connecting from the same remote machine?
 (Server 3.23.41 on a RedHat 7.2. The client is Windows XP
 Professional.)

 In other words, say we are connecting from Host B to Server A. Well, I
 will list the possible responses I'm getting (remember, always speaking of
 low level socket connections).

 - telnet servera 3306-- Response OK. (First handshake
 packet received OK).
 - MySQLFront -- Response OK. (MySQLFront connects
 OK).
 - mysql -u user -h servera   -- Response OK. (MySQL client
 connects OK).
 - nc servera 3306-- Response OK. (First handshake
 packet received OK).

 OK, at this point, you do think all is ok, don't you? not quite...

 - Connecting via a simple TCP socket coded in Borland C++ Builder
 5.0:
   The first packet response is:  1130: Host 'hostb' isn't allowed
 to connect to this mysql server.
   I am not even allowed to reply with the packet that identifies my
 to the server.

   Pardon? What?? I'm not ALLOWED to connect to the server?

 As you can see, this is nonsense because I CAN connect to the server as
 seen above. I have not come to a conclusion on this topic, so all you can
 help is greatly appreciated.

 I go so far as to capture the packets with a packet sniffer (ethereal),
 and I got crazy: Everything seems fine, all connections generate the same
 packets, in the same order... But when connecting from my program, I get
 that 1130 error.

 Cheers,
 Jose Miguel.

 PS: Yes, I have done a mysqladmin flush-hosts everytime.

-- 

Valentin Nils
Internet Technology

 E-Mail: [EMAIL PROTECTED]
 URL: http://www.knowd.co.jp/staff/nils

 
 182-0024 4-6-1 7F
 Phone: 0424-40-7912 Fax: 0424-40-7913
 URL: http://www.knowd.co.jp



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Problem connecting with sockets to MySQL

2003-05-29 Thread Jose Miguel Prez
Hi Nils!

First of all, thanks for your reply.

 I believe you miss an important point. Error 1130 means that the host (ip
 address) is not allowed to connect, it doesnt mean that its not physically
 possible. You have to check the privileges you gave the user or host that
 doesnt work.

Yes, the privileges is all set. Read my post again and you can see I'm
explaining that connecting with the mysql client all goes OK and trying to
connect with a socket I receive the error.

It all goes like this:

A) Connecting with mysql -h myhost -u user.
Using the command line client all goes ok, I can connect. This
is indication for all the privileges are correctly set.

B) Connecting with a socket in my C++ program I receive the 1130
error.
(This obviously using the SAME machine, not speaking the same
IP).

What troubles me is what the heck does the libmysql.dll to connect
correctly that I can't replicate using a socket.

I suppose (and only suppose) I can migrate the server from 3.23.41 to
4.0.13 and all this goes away. If that is the case, I imagine I have catched
a bug to the 3.23.41 version. However, I have read all the changelogs up to
4.0 and it doesn't say anything the developers have changed something to the
low level connection layer or something.

Cheers,
Jose Miguel.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]