Translation: MariaDB DATABASE (), mariadbdatabase

Source: Internet
Author: User
Tags mysql command line

Translation: MariaDB DATABASE (), mariadbdatabase

This document is the description of the official mariadb Manual: DATABASE.

Original article: https://mariadb.com/kb/en/library/database/
Https://mariadb.com/kb/zh-cn/database/ I submitted to the MariaDB official manual

Syntax
DATABASE()
Description

Returns the default (current) database name for a string in utf8 character set format. If no default DATABASE exists, DATABASE () returns NULL. In a stored procedure, the default database is the database associated with the procedure. It can be different from the default database in the context of the calling procedure.

SCHEMA () is a synonym for DATABASE.

You can USE the USE statement to specify the default database. Another way to set the default database is to specify the database name when the mysql command line client starts.

Example
MariaDB [(none)]> SELECT DATABASE();+------------+| DATABASE() |+------------+| NULL       |+------------+MariaDB [(none)]> USE testDatabase changedMariaDB [test]> SELECT DATABASE();+------------+| DATABASE() |+------------+| test       |+------------+

 

Go back to the Linux series article outline: workshop!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.