[racket] Got some trouble the the mysql-connect

From: MingQian Zhang (zmingqian at qq.com)
Date: Fri Nov 18 02:23:30 EST 2011

Hi all:


I got some errors when using new (require db) module.
Here are the two errors:
1.  io:read-null-terminated-bytes: internal error: communication problem (unexpected EOF)
2. parse-packet: internal error: communication problem (expected authentication ok packet)


The whole thing is like this:
1. write my code like this:
(require db)
(define sql-exp 
  (mysql-connect #:server "my sql server ip"
                 #:port 3306
                 #:database "name"
                 #:user "user"
                 #:password "password"))


2. when I run this code , I met my problems:
I have two mysql servers to connect, they are in different ips.


when use the code to connect 1 , I got Error 1:
  io:read-null-terminated-bytes: internal error: communication problem (unexpected EOF) 


Then I tried to connect server 2, I got another error:
  parse-packet: internal error: communication problem (expected authentication ok packet) 


3. other tries
After got the errors, I tried to connect a localhost server,
Like this :
(define test 
  (mysql-connect #:server "localhost"
                 #:port 3306
                 #:database "test"
                 #:user "root"))


It's OK and no error happens.


Then I tried this in a virtual machine like this 
 (define test 
  (mysql-connect #:server "10.0.2.2"
                 #:port 3306
                 #:database "test"
                 #:user "root"))

It's OK , too.


Also I tried postgresql, it's OK , too.


Can you help me to figure out what's wrong when connecting my mysql server ?
Thanks very much!


MQ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111118/365a6ae0/attachment.html>

Posted on the users mailing list.