Can WordPress only use the database inside ClawCloud?

Viewed 48

Has anyone tried setting up WordPress with a remote MySQL database? I tried modifying the WORDPRESS_DB_NAME, WORDPRESS_DB_USER, WORDPRESS_DB_PASSWORD, and WORDPRESS_DB_HOST in wp-config.php, but it still doesn’t work. Could it be that the container has no external network access?

/*Default settings*/
/*define( 'DB_NAME', getenv_docker('WORDPRESS_DB_NAME', 'wordpress') );
define( 'DB_USER', getenv_docker('WORDPRESS_DB_USER', 'example username') );
define( 'DB_PASSWORD', getenv_docker('WORDPRESS_DB_PASSWORD', 'example password') );
define( 'DB_HOST', getenv_docker('WORDPRESS_DB_HOST', 'mysql') );*/

Remote MySQL Database
define( 'DB_NAME', 'wordpress' );
define( 'DB_USER',  'user_name' );
define( 'DB_PASSWORD', *******' );
define( 'DB_HOST',  '***.***.***.***' );

1 Answers

The issue has been identified. Clawcloud accesses the database using dynamic IPs, so allowing only a single fixed IP is insufficient. I have modified the last two segments of the database firewall rule to .0.0, resulting in something like xxx.xxx.0.0/16, and now it works properly!