The hard data first:
Local machine: Xubuntu 17.10, with MySql-Workbench 6.3
Remote Machine: Ubuntu 16.04, with MySql-Client 5.7 and MySql-Server 5.7
The connection method is: Standard TCP/IP over SSH
The error:
Your connection attempt failed for user 'root' from your host to server at 127.0.0.1:3306: Can't connect to MySQL server on '127.0.0.1' (111)
Then it gives me a list with things to check.
1 Check that mysql is running on server 127.0.0.1
check
2 Check that mysql is running on port 3306
check
3 Check the root has rights to connect to 127.0.0.1 from your address
I checked the mysql.user table and it says that root
has the host: localhost
and since MySql-Workbench does an ssh connect to the remote machine and then connects to the MySql-Server, localhost should be fine.
Nonetheless I tried setting the host to %
as a wildcard but that didn't change anything either so I switched back to default localhost.
I also checked the my.cnf
. That is the entire content of it:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
There is no bind-address
or skip-networking
directive set.
4 Make sure you are both providing a password if needed and using the correct password for 127.0.0.1 connecting from the host address you're connecting from
Password and stuff is all fine. Passwords are set, they are typed correctly when logging in.
When I do, what Workbench is supposed to do
- ssh to the remote machine (
ssh user@remotemachine
) - login to mysql server (
mysql -u root -p
)
It works flawlessly I just can't do via MySql-Workbench
Help is much appreciated because I already tried everything I was able to research.
bind-address=127.0.0.1
(line 23) andskip-networking
(line 24). When I restart mysql it returns two errors in sudo journalctl -xe:mysqld: [ERROR] Found option without preceding group in config file /etc/mysql/my.cnf at line 23! mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
[mysqld]
. Now it restarts without errors but I still can't connect.