(Yes, this question seems very similar, but I understand why I get the message. What I don't get, and can't find any palpable information about on my own, is what to do about it. So here I am.)
I am trying to set up Postfix and Dovecot on my VPS, deciding to go the MySQL-route with MariaDB. Following this guide, which seems pretty okay.
Got as far as to test the DB config files with postmap, when the server simply refused connection. This is the error message I get;
postmap: warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on '127.0.0.1' (111 "Connection refused")
postmap: fatal: table mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf: query error: Transport endpoint is not connected
MariaDB's config file is set up to bind with 127.0.0.1, I opened 3306 for 127.0.0.1 and even tried disabling the firewall altogether without any change.
It seems that the IP and port can't be to blame then, and I assume this "Transport endpoint" must be the culprit - if that's not just another way of referring to the IP/port.
If anyone has suggestions as to what I can try to get around this, I would be incredibly grateful.
Edit: If it makes any difference, I'm using nginx as well.
Edit II: Results of 'service mysql status':
* /usr/bin/mysqladmin Ver 9.1 Distrib 10.1.11-MariaDB, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Server version 10.1.11-MariaDB-1~trusty-log
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 2 hours 37 min 16 sec