Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st April 2014
J65nko J65nko is offline
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,610
Default Show default MySQL database

With MySQL you can easily switch between databases. The following SQL snippet allows you to make sure that you are working with the correct database:
-- MySQL show current, default or database in use ...

select "Current database in use ...." 
select database() ;
mysql> source show-use ;
| Current database in use .... |
| Current database in use .... |
| Siralas2013                  |
2 rows in set (0.00 sec)

mysql> use Siralas2012 ;
Database changed

mysql> source show-use ;
| Current database in use .... |
| Current database in use .... |
| Siralas2012                  |
2 rows in set (0.00 sec
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #2   (View Single Post)  
Old 1st April 2014
LeFrettchen's Avatar
LeFrettchen LeFrettchen is offline
Marveled user
Join Date: Aug 2012
Location: France
Posts: 394

You can do the same with the PostgreSQL function CURRENT_DATABASE() :

postgres=# select current_database() ;
(1 row)

Oh, and... well, the title is not really good, isn't it ?
That's not the default database, but the current database, right ?
ThinkPad W500 P8700 6GB HD3650 SSD
ThinkStation P700 2x2620v3 32GB 1050ti SSD 3xHDD
Reply With Quote

mysql default database

Thread Tools
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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL database import not helpful J65nko General software and network 2 10th December 2011 02:45 AM
Read Excel Data and store into Mysql Database using PHP cksraj Programming 2 3rd June 2009 12:09 PM
Roundcube Mail Can't Connect to MYSQL Database jrs665 OpenBSD Packages and Ports 1 17th November 2008 03:54 PM
mplayer do not show subtitle mfaridi OpenBSD Packages and Ports 3 12th November 2008 05:41 AM
Changing encoding of text in MySQL database stukov Programming 5 15th July 2008 09:48 PM

All times are GMT. The time now is 03:58 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick