in reply to check if databse exists before connection is made!

Nik,

You might want to use DBI->data_sources or _ListDBs to get a list of available databases for a mysql server. See Private MetaData Methods inside DBD::mysql for more information.

If what you are looking for is to find out if the database server is running, just try to do a DBI->connect and check to see if the returned object is defined, probably with RaiseError set to 0 if you think it isn't a fatal condition.

Regards,
techy

  • Comment on Re: check if databse exists before connection is made!