How can I fix the error: Host '127.0.0.1' is not allowed to connect to this MariaDB server?

When looking at the server mail log you see this:

Apr  4 11:01:15 alma amavis[3540852]: (3540852-05) (!)connect_to_sql: unable to connect to DSN 'DBI:MariaDB:database=danami_warden;host=127.0.0.1': Host '127.0.0.1' is not allowed to connect to this MariaDB server
Apr  4 11:01:15 alma amavis[3540852]: (3540852-05) (!!)TROUBLE in check_mail: gen_mail_id FAILED: connect_to_sql: unable to connect to any dataset at /usr/share/perl5/vendor_perl/Amavis/Out/SQL/Connection.pm line 255.
Apr  4 11:01:15 alma postfix/cleanup[3534095]: 8AD7A1004203BC: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 4.5.0 Error in processing, id=3540852-05, gen_mail_id FAILED: connect_to_sql: unable to connect to any dataset at /usr/share/perl5/vendor_perl/Amavis/Out/SQL/Connection.pm line 255.; from=<root@alma.example.com> to=<root@alma.example.com>
Apr  4 11:01:15 alma psa-pc-remote[424364]: Message aborted.

To fix this edit the file /etc/my.cnf and any files in /etc/my.cnf.d/ and comment out or remove the line skip-name-resolve = 1 . Then restart mariadb.

systemctl restart mariadb
  • mariadb, skip-name-resolve
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

ClamAV will not start. How can I fix the ClamAV error: daily.{c[vl]d,inc} was not met?

ClamAV refuses to start and when viewing the status you see...

How can I fix any statistics generation problems?

Missing the Warden Crontab Entry There is a crontab entry that will update Warden statistics...

How can I fix the error: "milter-reject: END-OF-MESSAGE from..." in the log and found the AV in error (cannot read /etc/clam.d/scan.conf).

Cloudlinux / Imunify360 added their own version of ClamAV to their repo which accidentally...

How can I fix the error: Can't connect to TCP port 10024 on 127.0.0.0 [Address already in use] when trying to start Amavis?

When trying to start Amavis you see this in the mail log: Oct 02 03:20:15 condor3648 systemd[1]:...

How can I fix the error: Can't connect to TCP port 10024 on ::1 [Cannot assign requested address] when trying to start Amavis?

When trying to start Amavis you see this in the mail log: Oct 02 03:20:15 condor3648 systemd[1]:...