
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Default MySQL Database for the User
Actually, there is no default database for the user. But we have default database for the current session. It can be seen from the following query −
mysql> Select Database(); +------------+ | Database() | +------------+ | sample | +------------+ 1 row in set (0.00 sec)
The above result set shows that we are using ‘sample’ database currently. It is set for the current session. We can set another database, with the help of USE statement, also for the current session as follows −
mysql> USE query; Database changed mysql> Select Database(); +------------+ | Database() | +------------+ | query | +------------+ 1 row in set (0.00 sec)
Now, ‘query’ would be the default database for the current session.
Advertisements