Listing database and table names in a database?
I'm thinking of making a sandbox system for clients to preview website projects. I'd like to make a UI for myself/coworker(s) to add projects and clients to a database. Some of these projects require their own databases.
Let's say a client wants a WordPress based blog - they need a database. So, my system will allow the admin to create the requisite database. Now, in my sandbox system, I want to keep track of which dummy databases开发者_运维技巧 belong to which users.
Is it a bad idea to keep a table of databases that are per project? Is my whole concept unsound?
I don't think this is necessary because you can just run SHOW DATABASES
to retrieve all the database names.
To retrieve the tables for a given database, you can run:
SHOW TABLES FROM db_name;
精彩评论