Hello @ivangretsky,
I don’t use Laravel but I just tried to simulate your connections from my own Hestia Server and redirecting a port via ssh tunnel from another machine.
Note: I’m using a fresh Hestia CP 1.8.8 installed on Debian 12 (AMD64) and MariaDB 10.11.4.
1.- Testing connection to MariaDB from local user in Hestia Server (localhost
, loopback ip
, localhost + port 3306
, loopback ip + port 3306
):
localhost only
$ mysql --host=localhost --user=test_MyUser --password='MyPass' --default-character-set=utf8mb4 test_testmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4117
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test_testmysql]> quit
Bye
loopback ip
$ mysql --host=127.0.0.1 --user=test_MyUser --password='MyPass' --default-character-set=utf8mb4 test_testmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4118
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test_testmysql]> quit
Bye
localhost + port 3306
$ mysql --host=localhost --port=3306 --user=test_MyUser --password='MyPass' --default-character-set=utf8mb4 test_testmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4119
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test_testmysql]> quit
Bye
loopback ip + port 3306
$ mysql --host=127.0.0.1 --port=3306 --user=test_MyUser --password='MyPass' --default-character-set=utf8mb4 test_testmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4130
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test_testmysql]> quit
Bye
All tests are working fine.
2.- Testing connection to MariaDB from another machine and redirect local port 3336 (I can’t use port 3306 because I’ve a MariaDB server running on that port) to port 3306 via ssh tunnel with Hestia Server:
$ ssh -N -L 3336:127.0.0.1:3306 -i ~/.ssh/MyUser.hestiaserver MyUser@hestiaserver
Now I try to connect using loopback ip
and localhost
:
loopback ip + port 3336
$ mysql --host=127.0.0.1 --port=3336 --user=test_MyUser --password='MyPass' --default-character-set=utf8mb4 test_testmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4138
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test_testmysql]> quit
Bye
localhost + port 3336
$ mysql --host=localhost --port=3336 --user=test_MyUser --password='MyPass' --default-character-set=utf8mb4 test_testmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4139
Server version: 10.11.4-MariaDB-1~deb12u1 Debian 12
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [test_testmysql]> quit
Bye
And again, all is working fine.
I don’t know what is doing Laravel or how are you runnig the tunnel but as you can see, in my tests all is working as expected.
Cheers,
sahsanu