Get your free beta license ↗
Databases · MariaDB

A database connection from another computer fails

Last updated 30 Nov 2026
Summary

A connection to MariaDB from another computer is refused or times out. UrbeStack keeps outside connections closed, so configure the listener, open the firewall port, and create a database user for the IP address you connect from.

Symptoms

A connection from another computer times out when the firewall drops it.

Once the port is open, MariaDB refuses the connection if the database user has no account for the remote IP address. The mariadb 10.11 client shows this error.

Output
ERROR 2002 (HY000): Received error packet before completion of TLS handshake. The authenticity of the following error cannot be verified: 1130 - Host '203.0.113.5' is not allowed to connect to this MariaDB server

Other clients show ERROR 1130 (HY000): Host '203.0.113.5' is not allowed to connect to this MariaDB server.

Cause

On AlmaLinux, MariaDB listens on every IP address. On Ubuntu, it listens only on 127.0.0.1. UrbeStack leaves the listener configuration to the distribution and to you.

UrbeStack's firewall keeps port 3306 closed on both distributions. The database users UrbeStack creates exist only for local connections from localhost, 127.0.0.1, and ::1.

Resolution

  1. On Ubuntu, set bind-address = 0.0.0.0 under [mysqld] in /etc/mysql/mariadb.conf.d/50-server.cnf, then run urbestack-service-restart --name mariadb.

  2. Check where MariaDB listens.

    ss -tln | grep 3306
  3. Open port 3306 in UrbeStack's firewall. Use your own text for the rule's note.

    urbestack-firewall-rule-add --kind port --value 3306 --note 'MariaDB for 203.0.113.5'
  4. The rule opens the port to every IP address. The database user's host limits which IP address can log in with that account.

  5. Create a database user for the remote IP address using the same name as the user in UrbeStack.

    mariadb -e "CREATE USER 'example_db'@'203.0.113.5' IDENTIFIED BY 'a-password'"
  6. From then on, UrbeStack applies the user's password and grants to the remote host at every change, as it does for the local hosts. Set the password again through UrbeStack so all hosts share it.

    urbestack-database-user-set --name example_db --password-stdin
  7. To close the port again, find the rule's number with urbestack-firewall-rule-list and remove the rule with urbestack-firewall-rule-del --id N.