Wordpress: Not allowed to connect to MariaDB server

Created on 19 Mar 2015  路  10Comments  路  Source: docker-library/wordpress

I know this is a mariadb issue but nontheless the docker compose file doesn't seem to work because by default MariaDB container doesn't allow remote connections:

Warning: mysqli::mysqli(): (HY000/1130): Host '172.17.0.19' is not allowed to connect to this MariaDB server in - on line 10

I've only gotten this since today when i pulled the latest mariadb image.

Most helpful comment

I've faced with the same error on mariadb:10.4.6

All 10 comments

The mariadb image is made to accept connections on any address, which is why we comment out the bind-address line.

I think this was an issue with the mariadb docker image 10.1.x. Try specifying to use the 10.0.x series

+1

I have the same issue with mariadb 10.0.19
I am using dnsdock to avoid hard links between fpm and mariadb.

dnsdock:
  image: tonistiigi/dnsdock
  hostname: dnsdock
  command: -ttl=30
  restart: always
  dns:
    - 172.17.42.1
    - 8.8.8.8
  ports:
    - "8080:80"
    - "172.17.42.1:53:53/udp"
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock

wordpress:
  image: wordpress:fpm
  environment:
    WORDPRESS_DB_HOST: mariadb.docker
    WORDPRESS_DB_USER: wp
    WORDPRESS_DB_PASSWORD: "1234"
  volumes:
    - /data/wp:/var/www/html

mariadb:
  image: mariadb:10.0.19
  volumes:
    - /data/mariadb:/var/lib/mysql
  environment:
    MYSQL_USER: wp
    MYSQL_PASSWORD: "1234"
    MYSQL_ROOT_PASSWORD: "1234root"
...
mariadb_1   | 150526 11:08:01 [Note] Plugin 'FEEDBACK' is disabled.
mariadb_1   | 150526 11:08:01 [Note] Server socket created on IP: '::'.
mariadb_1   | 150526 11:08:01 [Note] Event Scheduler: Loaded 0 events
mariadb_1   | 150526 11:08:01 [Note] Reading of all Master_info entries succeded
mariadb_1   | 150526 11:08:01 [Note] Added new Master_info '' to hash table
mariadb_1   | 150526 11:08:01 [Note] mysqld: ready for connections.
mariadb_1   | Version: '10.0.19-MariaDB-1~wheezy-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
mariadb_1   | 150526 11:08:01 [Warning] IP address '172.17.1.50' could not be resolved: Name or service not known
wordpress_1 | 
wordpress_1 | Warning: mysqli::mysqli(): (HY000/1130): Host '172.17.1.50' is not allowed to connect to this MariaDB server in - on line 10
wordpress_1 | 
wordpress_1 | MySQL Connection Error: (1130) Host '172.17.1.50' is not allowed to connect to this MariaDB server

would it be possible to add a host during start?

http://stackoverflow.com/questions/1559955/host-xxx-xx-xxx-xxx-is-not-allowed-to-connect-to-this-mysql-server

mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON _._ TO 'monty'@'localhost'
-> WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON _._ TO 'monty'@'%'
-> WITH GRANT OPTION;

Interesting, im getting the same thing. I moved from mariadb to mariadb:10.0 and it worked. Something changed with the configuration.

I _think_ this might have been during the short period where MariaDB 10.1 was not working correctly. I've just explicitly tested the newest mariadb:10.1 image against the newest wordpress:latest and verified that they do function together appropriately (and that I can access the Wordpress UI). :+1:

I've faced with the same error on mariadb:10.4.6

I also have the same issue with mariadb:10.4.11 initially. But after waiting for a fairly long time (~5 minutes), there suddenly was more output from the mariadb container and I was able to connect.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mvasin picture mvasin  路  4Comments

TeachMeHowToUse2FA picture TeachMeHowToUse2FA  路  4Comments

andheiberg picture andheiberg  路  5Comments

danyork picture danyork  路  4Comments

charltones picture charltones  路  5Comments