kaliza Posted August 4, 2007 Share Posted August 4, 2007 Im working on a database management script and i was wondering how can i get to see all the databases on my server using PHP as an interface, the "show database" will work only if all databases will have the same Username , password as the on i am connected to the Mysql. if i run show databases and im connected with user1 it will display all the ones that user1 has priviliges to only, so what about the ones with user2?!? im looking for something like how PhpMyAdmin does. ??? Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/ Share on other sites More sharing options...
lightningstrike Posted August 4, 2007 Share Posted August 4, 2007 phpMyAdmin uses an account that has access to all of your databases. If you are not on a shared server you should be able to use the same account to do such as well. just use mysql_list_dbs([$link]) Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/#findComment-315521 Share on other sites More sharing options...
kaliza Posted August 4, 2007 Author Share Posted August 4, 2007 but what im trying to do , is display all databases on my shared server, and the databases have 3 different users, how do i get that account that accesses all 3, with out just using 1 user for all 3? i wanna make a script so when u load the page it list all the dbs and then u can click on the one u wanna edit or monitor phpMyAdmin uses an account that has access to all of your databases. If you are not on a shared server you should be able to use the same account to do such as well. just use mysql_list_dbs([$link]) Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/#findComment-315772 Share on other sites More sharing options...
lightningstrike Posted August 4, 2007 Share Posted August 4, 2007 Not possible, make one user for all three. The only other solution is to use all three users to find the database for each one. Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/#findComment-315775 Share on other sites More sharing options...
dbo Posted August 4, 2007 Share Posted August 4, 2007 Yeah, that's how you gotta due it. This is a security feature in MySQL and no way to show a database if the user doesn't have privileges to know its there. Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/#findComment-315779 Share on other sites More sharing options...
kaliza Posted August 5, 2007 Author Share Posted August 5, 2007 so phpmyadmin had the admin user or something that see's all of them Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/#findComment-315855 Share on other sites More sharing options...
dbo Posted August 5, 2007 Share Posted August 5, 2007 Yes. Depending on who you log in as.... their permissions are what you can see. Quote Link to comment https://forums.phpfreaks.com/topic/63303-show-all-databases-on-your-server-even-if-they-have-diff-users/#findComment-315858 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.