USEq"/> USEq">

Home  >  Article  >  Database  >  What does the user default MySQL database mean?

What does the user default MySQL database mean?

WBOY
WBOYforward
2023-08-24 09:09:111386browse

用户默认的 MySQL 数据库是什么意思?

Actually, users do not have a default database. But we have the default database for the current session. As 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 currently using the "sample" database. It is set for the current session. We can set up another database for the current session with the help of USE statement as shown below -

mysql> USE query;
Database changed

mysql> Select Database();
+------------+
| Database() |
+------------+
| query      |
+------------+
1 row in set (0.00 sec)

Now, "query" will become the default database for the current session.

The above is the detailed content of What does the user default MySQL database mean?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete