The question is about an inbound connection (to connect to the hosting package database), which Afrihost does allow.
In the site's cPanel, go to Remote MySQL and enter your IP address. This needs to be your public IP address (do a Google search for "what is my IP address" to get it). If you're on ADSL this address may change regularly, so you probably want to add your IP address as xxx.xxx.xxx.% or even xxx.xxx.% on the Remote MySQL page. Then you can use the server's Shared IP Address (you can find it on the main cPanel page) as the server address in your connection string/options.