This is my first post here, I hope you can help me.
What I'm triying to do, is connect via reverse SSH to a company' remote server.
COMPANY $ ssh -R 36060:localhost:22 local@x.x.x.x
Then in the local
LOCAL $ ssh company@localhost -p 36060
LOCAL $ mysql -h 127.0.0.1 -u root -p root
Everything is good, the conection works in the terminal, I can see the tables, no problem.
After all this, in the php archive.
<?php
$cnn = mysqli_connect('127.0.0.1','root','root','user_database',33060);
?>
But always send me an error when I try to opened in the browser.
Warning: Packets out of order. Expected 0 received 45. Packet size=4739923 in /opt/lampp/htdocs/test.php on line 2
Warning: mysqli_connect(): MySQL server has gone away in /opt/lampp/htdocs/test.php on line 2
I try to change the config in the "test server", change in LOCAL and COMPANY the max_allowed_packet = 128M in my.cf but nothing works.
If you have any idea, please help :(
EDIT: Problem solved!
SERVER $ ssh -fNT -R 33060:localhost:3306 xxxxxxx@xxxxxxxxx.cl
LOCAL $ mysql -h 127.0.0.1 -P 33060 -u root -p
And works perfecty :D