Не получается подключиться к mysql через ssh-тунель.
Делаю так:
Запускаю в фоне ssh, для поднятия тунеля:
[iskatel@mastersrv ~]$ (ssh -L 33061:127.0.0.1:3306 iskatel@192.168.212.1 &)
[iskatel@mastersrv ~]$ echo 'SHOW DATABASES;' | mysql --port=33061 --user=root -t mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Локально подключиться получается:
iskatel@siplant:~$ echo 'SHOW DATABASES;' | mysql --user=root -t mysql
+--------------------+
| Database |
+--------------------+
| information_schema |
| acl_siplant |
| mysql |
| siplant |
| siplant_new |
+--------------------+
iskatel@siplant:~$ echo 'SELECT Host,User,Password FROM user;' | mysql --user=root -t mysql
+-----------+------------------+-------------------------------------------+
| Host | User | Password |
+-----------+------------------+-------------------------------------------+
| localhost | root | |
| siplant | root | |
| 127.0.0.1 | root | |
| localhost | debian-sys-maint | *F930640RRD01399ABB590522FABCD52A39E7947E |
| localhost | plannet | *28A09A9RR3E263FBEA39AFA86ABCD2AD2444C711 |
| 127.0.0.1 | siplant | *6138D32RRD61508507CAB0E28ABCD9E10872F4D1 |
| localhost | siplant | *6138D32RRD61508507CAB0E28ABCD9E10872F4D1 |
| % | rsiplant | *B76AC77RR1C7F2D63119812C0ABCDA6568CDC1FF |
+-----------+------------------+-------------------------------------------+
iskatel@siplant:~$ echo 'SELECT Host,Db,User FROM db;' | mysql --user=root -t mysql
+-----------+-------------+---------+
| Host | Db | User |
+-----------+-------------+---------+
| 127.0.0.1 | siplant | siplant |
| localhost | acl_siplant | siplant |
| localhost | elcom | plannet |
| localhost | siplant | siplant |
| localhost | siplant_new | siplant |
+-----------+-------------+---------+