Login to the cPanel server as the root user via SSH or Terminal
Check to see if the database process is listening publicly already. The following shows that the MySQL process is listening only on localhost (127.0.0.1) which will prevent remote connections:
ss -tunlp | grep -i "mysql\|maria\|3306"
tcp LISTEN 0 0 127.0.0.1:3306 *:* users:(("mysqld",1814,24))
If the database is listening only on localhost, edit the /etc/my.cnf file and add the following configuration under the [mysqld] section:
bind-address=*
NOTE: Be sure to remove any existing bind-address configurations.
Restart the server with the following command:
/scripts/restartsrv_mysql --restart
Verify that MySQL or MariaDB is now listening on * which means that it will bind to all IP addresses of the server, both public and private:
ss -tunlp | grep -i "mysql\|maria\|3306"
tcp LISTEN 0 0 *:3306 *:* users:(("mysqld",30016,12))
NOTE: You may also specify a particular IP address if you want, but the * option is generally perfectly fine to use.