MariaDB refuses remote connections

The solution to the error in my case was that there was no [mysqld] section at all in the my.cnf config files. Adding this solved the issue:

[mysqld]
bind-address = ::

Not sure why it was not added by default. Note that the reason to use :: over 0.0.0.0 is that :: works for IPv6 too (mentioned in mySQL manual, but not mariaDB manual).

This also fixed the telnet:

mint@mint-VirtualBox ~ $ telnet 128.199.203.208 3306
Trying 128.199.203.208...
Connected to 128.199.203.208.

And the network output is now:

[user]@popfreq:/etc/mysql$ sudo netstat -ntlup | grep mysql
tcp6       0      0 :::3306                 :::*                    LISTEN      17609/mysqld   

Hope this helps someone else.


After having the same problem (on Debian Stretch) and already tried all the solutions mentioned here without any success, I finally found this from where I just post the important part:

Edit /etc/mysql/mariadb.conf.d/50-server.cnf, comment the bind-address, and add the sql-mode statement:

[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address           = 127.0.0.1

sql-mode="NO_ENGINE_SUBSTITUTION"

[...]

and - it worked.