Estou executando o Debian 8.2 e a instalação é bem recente. Eu tento me conectar ao meu servidor MySQL via SSH usando o Sequel Pro. Eu sempre recebo este erro:
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
Quando eu corro
mysql -u root -p
no servidor, tudo funciona perfeitamente. Mas não de longe.
No começo eu pensei que poderia ser iptables, então eu (temporariamente) desabilitei todas as regras. iptables -L agora retorna:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Então eu verifiquei o my.cnf, mas todos os parâmetros que eu pude pensar parecem corretos:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = 127.0.0.1
A saída dos meus arquivos de log do mysql também parece ok
150609 17:15:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150609 17:15:07 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
150609 17:15:07 [Note] /usr/sbin/mysqld (mysqld 5.5.43-0+deb8u1) starting as process 18347 ...
150609 17:15:07 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
150609 17:15:07 [Note] Plugin 'FEDERATED' is disabled.
150609 17:15:07 InnoDB: The InnoDB memory heap is disabled
150609 17:15:07 InnoDB: Mutexes and rw_locks use GCC atomic builtins
150609 17:15:07 InnoDB: Compressed tables use zlib 1.2.8
150609 17:15:07 InnoDB: Using Linux native AIO
150609 17:15:07 InnoDB: Initializing buffer pool, size = 128.0M
150609 17:15:07 InnoDB: Completed initialization of buffer pool
150609 17:15:07 InnoDB: highest supported file format is Barracuda.
150609 17:15:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
150609 17:15:08 InnoDB: Waiting for the background threads to start
150609 17:15:09 InnoDB: 5.5.43 started; log sequence number 1654586
150609 17:15:09 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
150609 17:15:09 [Note] - '127.0.0.1' resolves to '127.0.0.1';
150609 17:15:09 [Note] Server socket created on IP: '127.0.0.1'.
150609 17:15:09 [Note] Event Scheduler: Loaded 0 events
150609 17:15:09 [Note] /usr/sbin/mysqld: ready for connections.
E não consigo encontrar problemas com a configuração dos meus clientes:
MySQL Host: 127.0.0.1
User: root
Password: ***
Port: 3306
SSH Host: mydomain.com
SSH User: sshuser
SSH Key: sshkey
Eu também não tenho nada em /etc/hosts.allow e /etc/hosts.deny
Observe que o SSH se conecta com sucesso, mas o MySQL falha.
Estou perdido. Alguém pode ajudar?