Error establising a database connection


I installed wordpress. Configured the wp-config.php parameters to connect to a mariadb. And deployed to two docker containers using Dokku.
These are the wp-config.php parameter I set:
define( ‘DB_NAME’, ‘wp_blog_db’ );
define( ‘DB_PASSWORD’, ‘a41…6a’ );
define( ‘DB_USER’, ‘root’ );
define( ‘DB_HOST’, ‘tcp://172.17.0.2:3306’ );

I get this error:
mysqli_real_connect(): (HY000/2002): Connection refused in /app/wp-includes/wp-db.php on line 1626

What was tried out:
– ping to mariadb container successfully.
– Inside the mariadb, logged in as root with the password specified in wp-config.php and ‘wp_blog_db’ was verified to be their using ‘view databases;’ command.
– Run command telnet 172.17.0.2 3306 from inside wp container. And here is the result. Mariadb is under 172.17.0.2
Trying 172.17.0.2…
Connected to 172.17.0.2.
Escape character is ‘^]’.
p
5.5.5-10.4.10-MariaDB-1:10.4.10+maria~bionicz#;?k}Sf??!(4h4f)5lEPCAmysql_native_passwordConnection closed by foreign host.

Any tips on what could be tried out?



Source link