There are no databases associated with your account message

Islandhosting

Member
May 15, 2015
21
4
53
Canada
cPanel Access Level
Root Administrator
Twitter
Got a user who has three databases, but in cPanel under "Current Databases" it says "There are no databases associated with your account. "

However, the databases exist and his sites work with them. That same cpanel page lists them in the select boxes for "Check Database" and "Repair Database", just not under the "Current Databases". The "Current User" list is fine.

I look at the /var/cpanel/databases/USER.json file and it seems to list the databases properly in there.

Running /scripts/update_db_cache and /usr/local/cpanel/bin/dbindex make no difference.

The map tool in WHM tells me the databases are already linked to the account.

Also, if I add a new database, then all of the databases suddenly *are* visible in the list, but when I delete the new database they all disappear again.

Any thoughts?
 
Last edited:

httpdocs

Well-Known Member
Mar 9, 2018
59
9
83
United States
cPanel Access Level
Root Administrator
Backup This Database in ssh with command:
mysqldump dbname>filename.sql

Remove Database in whm.
Create databases in User cpanel
and Restore This Database in ssh with command:
mysql dbname<filename.sql
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Hello,

Actually if you've not made these modifications yet, can you give me the output of the following:

Code:
grep "information_schema" /var/cpanel/cpanel.config
Then can you show me the output of the following (this is the API call with two separate API's)

Code:
uapi --user=$fulldbname Mysql list_databases
Code:
cpapi2 --user=$fulldbname MysqlFE listdbs

The method behind why I'm asking is due to the fact that there is a case open internally CPANEL-29053 in which databases with special characters are not showing in the UI or when using the UAPI when the Information Schema is disabled.
 

Islandhosting

Member
May 15, 2015
21
4
53
Canada
cPanel Access Level
Root Administrator
Twitter
Sure. With the extra test database in place I get this:

Code:
# grep "information_schema" /var/cpanel/cpanel.config
use_information_schema=0

# uapi --user=sublimel Mysql list_databases
---
apiversion: 3
func: list_databases
module: Mysql
result:
  data:
    -
      database: sublimel_ai4-1
      disk_usage: 0
      users:
        - sublimel_UAlbert
    -
      database: sublimel_ai5-1
      disk_usage: 0
      users:
        - sublimel_UAlbert
    -
      database: sublimel_ai6-1
      disk_usage: 0
      users:
        - sublimel_UAlbert
    -
      database: sublimel_fulcrum-1
      disk_usage: 0
      users:
        - sublimel_UAlbert
    -
      database: sublimel_test
      disk_usage: 4161
      users: []

  errors: ~
  messages: ~
  metadata:
    transformed: 1
  status: 1
  warnings: ~

# cpapi2 --user=sublimel MysqlFE listdbs
---
cpanelresult:
  apiversion: 2
  data:
    -
      db: sublimel_ai4-1
      size: 0
      sizemeg: '0.00'
      usercount: 1
      userlist:
        -
          db: sublimel_ai4-1
          user: sublimel_UAlbert
    -
      db: sublimel_ai5-1
      size: 0
      sizemeg: '0.00'
      usercount: 1
      userlist:
        -
          db: sublimel_ai5-1
          user: sublimel_UAlbert
    -
      db: sublimel_ai6-1
      size: 0
      sizemeg: '0.00'
      usercount: 1
      userlist:
        -
          db: sublimel_ai6-1
          user: sublimel_UAlbert
    -
      db: sublimel_fulcrum-1
      size: 0
      sizemeg: '0.00'
      usercount: 1
      userlist:
        -
          db: sublimel_fulcrum-1
          user: sublimel_UAlbert
    -
      db: sublimel_test
      size: 4161
      sizemeg: '0.00'
      usercount: 0
      userlist: []

  event:
    result: 1
  func: listdbs
  module: MysqlFE
  postevent:
    result: 1
  preevent:
    result: 1

But when I remove the test database, the uapi call returns this (the cpapi2 call is the same):

Code:
# uapi --user=sublimel Mysql list_databases
---
apiversion: 3
func: list_databases
module: Mysql
result:
  data: []

  errors: ~
  messages: ~
  metadata:
    transformed: 1
  status: 1
  warnings: ~
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
@Islandhosting

Does this start reporting correctly if you enable the information schema? Also which version of cPanel/WHM are you on? The case I'm referencing affects versions back to v74 and that hyphen in the database name ai6-1 for example would be considered a special character.

Per our internal case notes, the case I referenced should be resolved in v84 of cPanel/WHM.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
I understand, the issue being that right now, there's no workaround for the issue on v82 without enabling the Information Schema, or removing the special character. The case I referenced causes the behavior you've been seeing as well.