If database exists but is not showing in end user cPanel it possible database is not being tracked by the db mapping system.
First of all verify the user.yaml that database and username exists or not.
root@server [~]# cat /var/cpanel/databases/user.yaml
—
MYSQL:
dbs: {}
dbusers: {}
MYSQL:
dbs: {}
dbusers: {}
That’s mean No databases tracked:
Now perform the below steps to resolve the problem:
To map missing databases and users execute the below command:
#/usr/local/cpanel/bin/dbmaptool cpaneluser –type mysql –dbs ‘databasename’ –dbusers ‘dbusername’
For multiple databases
#/usr/local/cpanel/bin/dbmaptool user1 –type mysql –dbs ‘db1’ && /usr/local/cpanel/bin/dbmaptool user1 –type mysql –dbusers ‘virt1’
Then run the below command to verify the same
#cat /var/cpanel/databases/user.yaml
Output
dbs:
dbname: xx.xx.xx.xx
dbname: xx.xx.xx.xx
dbusers:
dbuser:
dbs: {}
server: xx.xx.xx.xx
cpses_ac88BOlH47:
dbs: {}
server: xx.xx.xx.xx
noprefix: {}
owner: cpanel user
server: xx.xx.xx.xx