PDA

View Full Version : list of databases



CyberAlien
01-23-2004, 12:41 PM
Hello,

Is there any file where script in skin can read list of mysql databases for current user?

DirectAdmin Support
01-23-2004, 12:55 PM
Hello,

I don't believe there is, but if you have the username/password for the user, you could just do a mysql query with that info to return all databases he has access to.

http://ca3.php.net/manual/en/function.mysql-list-dbs.php

John

CyberAlien
01-23-2004, 01:22 PM
i didn't mean mysql user - i meant server user. for every server user there might be several or none mysql users.

i need list similar to one in token |DATABASES| in /CMD_DB (preferably with passwords, but without passwords is also ok - i'll make user enter password)

DirectAdmin Support
01-24-2004, 01:13 PM
So... if you refering to the DA username login for mysql, could could probably just do a select statement where there is no '_' character.. (and parse out root and things like that)

Or if I'm not understanding you, and you just want a list of server users, http://www.directadmin.com/api.html#showusers would show everyone. (not all will be in the database tho, they have to create a db first).

John

CyberAlien
01-24-2004, 02:34 PM
Sorry, i don't think you understood me. mySQL commands cannot be used becuase to use it i need to know root login/password for mysql and that's not possible. And there is no special command in API to do that.

But nevermind. I'll just use API to get html page for /CMD_DB?DOMAIN=some_domain.com and then will parse it to get list.