Database Security. Database Auditing. Database Caching. Database Masking. Get it now

Login Root to GreenSQL listener Fail

in

Hi:

I try to login to verify all the installation it's OK (i read this form How To):
So, i do this:

debian:/etc/init.d# ./greensql-fw start
Starting greensql-fw: greensql-fw.
debian:/etc/init.d# netstat -an | grep 330
tcp 0 0 127.0.0.1:3305 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:3306 127.0.0.1:4302 ESTABLISHED
tcp 0 0 127.0.0.1:4302 127.0.0.1:3306 ESTABLISHED
tcp 0 0 127.0.0.1:4300 127.0.0.1:3306 TIME_WAIT
tcp 0 0 127.0.0.1:4301 127.0.0.1:3306 TIME_WAIT
tcp 0 0 127.0.0.1:4298 127.0.0.1:3306 TIME_WAIT
tcp 0 0 127.0.0.1:4297 127.0.0.1:3306 TIME_WAIT
debian:/etc/init.d# mysql -h 127.0.0.1 -P 3305 -u root -p
Enter password:
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading authorization packet', system error: 0
debian:/etc/init.d#

NOTE:

the 3305 port its the listener and 3306 its MySQL
Then the listener goes down, and i must reload the with the greensql-fw reload command.

Question 1:

What its worng? i check de log and theres no errors abaut MySQL connection.

Question 2:
My application must use the proxy port with the green db user to comunicate with databases?
For examples this is my app code:


<?php

#conectarse a la base de datos en MySql
$link = mysql_connect("127.0.0.1:3305","root","")
or die ("no se ha podido conectar");
#Seleccion de la base de datos a utilizar
mysql_select_db("prueba")
or die("Error al tratar de selecccionar esta base");

$sql = "INSERT INTO usuarios (nombre,apellido) VALUES ('nano','nano')";
mysql_query($sql);

mysql_close($link);
?>

When i execute this file, the page show me this error:


Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading authorization packet', system error: 0 in /opt/lampp/htdocs/test/registrar.php on line 5
no se ha podido conectar

What can i do?

Thanks!

Comments

Hi Can you paste few lines

Hi

Can you paste few lines from the greensql log file ?

It is located under the following path /var/log/greensql.log

Thanks,
Yuli

Hi Yuli: This is the

Hi Yuli:
This is the log.


[16/Nov/2008 8:21:17] INFO Application started
[16/Nov/2008 8:21:53] NET_DEBUG [1]wrap_Server
[16/Nov/2008 8:21:53] NET_DEBUG connection init()
[16/Nov/2008 8:21:53] NET_DEBUG GreenSQL Server_cb(), sfd=9, cfd=10
[16/Nov/2008 8:21:53] NET_DEBUG size of the connection queue: 0
[16/Nov/2008 8:21:53] NET_DEBUG [1]backend socket fired 10
[16/Nov/2008 8:21:53] NET_DEBUG packet size expected 56 bytes (received 56)
[16/Nov/2008 8:21:53] NET_DEBUG Socket_write
[16/Nov/2008 8:21:53] NET_DEBUG [1]frontend socket fired 9
[16/Nov/2008 8:21:53] SQL_DEBUG &..........@.... | 26 00 00 01 85 A2 00 00 00 00 00 40 08 00 00 00
[16/Nov/2008 8:21:53] SQL_DEBUG ................ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[16/Nov/2008 8:21:53] SQL_DEBUG ....root.. | 00 00 00 00 72 6F 6F 74 00 00
[16/Nov/2008 8:21:53] SQL_DEBUG PROTOCOL4.1
[16/Nov/2008 8:21:53] SQL_DEBUG LONG PWD
[16/Nov/2008 8:21:53] SQL_DEBUG USERNAME: root
[16/Nov/2008 8:21:53] SQL_DEBUG DATABASE:
[16/Nov/2008 8:25:56] INFO Application started
[16/Nov/2008 8:47:48] STORAGE Can't connect to MySQL server on '127.0.0.1' (111)
[16/Nov/2008 8:47:48] STORAGE Can't connect to MySQL server on '127.0.0.1' (111)
[16/Nov/2008 8:47:48] STORAGE (SELECT agroupid, proxyid, db_name, pattern FROM alert_group) Can't connect to MySQL server on '127.0.0.1' (111)
[16/Nov/2008 8:48:19] CRIT Killer
[16/Nov/2008 8:48:20] DEBUG config destructor
[16/Nov/2008 8:48:22] INFO Application started
[16/Nov/2008 8:48:44] NET_DEBUG [1]wrap_Server
[16/Nov/2008 8:48:44] NET_DEBUG connection init()
[16/Nov/2008 8:48:44] NET_DEBUG GreenSQL Server_cb(), sfd=9, cfd=10
[16/Nov/2008 8:48:44] NET_DEBUG size of the connection queue: 0
[16/Nov/2008 8:48:44] NET_DEBUG [1]backend socket fired 10
[16/Nov/2008 8:48:44] NET_DEBUG packet size expected 56 bytes (received 56)
[16/Nov/2008 8:48:44] NET_DEBUG Socket_write
[16/Nov/2008 8:48:44] NET_DEBUG [1]frontend socket fired 9
[16/Nov/2008 8:48:44] SQL_DEBUG &..........@.... | 26 00 00 01 85 A2 00 00 00 00 00 40 08 00 00 00
[16/Nov/2008 8:48:44] SQL_DEBUG ................ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[16/Nov/2008 8:48:44] SQL_DEBUG ....root.. | 00 00 00 00 72 6F 6F 74 00 00
[16/Nov/2008 8:48:44] SQL_DEBUG PROTOCOL4.1
[16/Nov/2008 8:48:44] SQL_DEBUG LONG PWD
[16/Nov/2008 8:48:44] SQL_DEBUG USERNAME: root
[16/Nov/2008 8:48:44] SQL_DEBUG DATABASE:

Thanks Yuli.

Hi: After a lots of tries,

Hi:
After a lots of tries, the listener works fine.

Some config what i change:
1) in php.ini the connection_timeout set to 60

When i tried to login as root whitout password to the greensql listener the error that i comment previously in this post apperars, but, if i login with a user who has a password, such green:pwd, it's works fine, now it works! so don't login with a user who has an empty passowrd to the listener.
I thinks that was the problem.

Goodbye ;)

P.D: thanks for your help, comming soon, after the final exams on my university i will send you the workaround to install and configure greensql with LAMPP.

Back to top