If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Does MySQL have a sysdatabases equiv?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-03, 15:31
jdierking jdierking is offline
Registered User
 
Join Date: Jan 2003
Location: Marysville, WA
Posts: 31
Question Does MySQL have a sysdatabases equiv?

I am trying to write a PHP Utility to backup MySQL databases.

I have a working app, however the downside is that I need to either manually create a list of dbs to backup or I need to keep a seperate database of all databases.

MSSQL hase a sysdatabases table in the master database.

It would be nice to do something like:

select name from sysdatabases
order by name

and get a complete list of all my databases to then process from.

Thanks in advance
__________________
Jeff Jones
Software Engineer
http://www.linkedin.om/in/jeffjones1972
jeff@lordjester.com
509-416-6784
Reply With Quote
  #2 (permalink)  
Old 10-12-03, 16:09
Mincer Mincer is offline
Registered User
 
Join Date: Sep 2003
Location: London
Posts: 56
Re: Does MySQL have a sysdatabases equiv?

Quote:
Originally posted by jdierking
.. get a complete list of all my databases to then process from..
Code:
show databases ;
Matt.
Reply With Quote
  #3 (permalink)  
Old 10-12-03, 16:24
jdierking jdierking is offline
Registered User
 
Join Date: Jan 2003
Location: Marysville, WA
Posts: 31
Does that work from PHP or from the command line?
__________________
Jeff Jones
Software Engineer
http://www.linkedin.om/in/jeffjones1972
jeff@lordjester.com
509-416-6784
Reply With Quote
  #4 (permalink)  
Old 10-12-03, 16:46
jdierking jdierking is offline
Registered User
 
Join Date: Jan 2003
Location: Marysville, WA
Posts: 31
Found the answer...

Not sure how it is achieved on the db side, but PHP has a function "mysql_list_dbs" that returns all dbs on the server.
__________________
Jeff Jones
Software Engineer
http://www.linkedin.om/in/jeffjones1972
jeff@lordjester.com
509-416-6784
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On