edi has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
How to check whether a MySQL database exist or not?
Thank you in advance!use DBI; eval { $dbh = DBI->do('dbi:mysql: xxxxx','root','') or die "Connection Error: $DBI::errstr\n"} ; if ($dbh == 'undef') { print "Table does not exist.\n"; } else { print "table exist"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to find MySQL database exist or not
by rcaputo (Chaplain) on Sep 01, 2011 at 17:46 UTC | |
Re: How to find MySQL database exist or not
by roboticus (Chancellor) on Sep 01, 2011 at 15:31 UTC | |
by JavaFan (Canon) on Sep 01, 2011 at 15:57 UTC | |
by roboticus (Chancellor) on Sep 01, 2011 at 16:07 UTC | |
by choroba (Cardinal) on Sep 01, 2011 at 16:09 UTC | |
by edi (Initiate) on Sep 02, 2011 at 11:16 UTC | |
by edi (Initiate) on Sep 02, 2011 at 11:12 UTC | |
by Marshall (Canon) on Sep 03, 2011 at 04:06 UTC | |
Re: How to find MySQL database exist or not
by Corion (Patriarch) on Sep 02, 2011 at 12:50 UTC | |
Re: How to find MySQL database exist or not
by Anonymous Monk on Sep 02, 2011 at 11:41 UTC |
Back to
Seekers of Perl Wisdom