You'll need to allow the connection from the Splunk instance to the DB, which in your case seems to be port 3306.
Port 8000 is the default port where splunkweb is running. It has nothing to do with DBConnect. But of course you'll have to allow inbound traffic to the Splunk server on that port for users connecting with their browsers.
Port 8089 is used by various splunk instances (forwarders, indexers, search heads etc)to talk to each other (deployment traffic, distributing searches etc).
Port 9997 is commonly used for sending log traffic from forwarders to indexers.
The indexer would initiate a connection from its side to the MySQL database, on whatever port the database is running. In your case, that's 3306.
Have you tried this and encountered an issue?