--database (--db, -D, -d)
This page is part of MariaDB's Documentation.
The parent of this page is: mariadb-shell for MariaDB Shell
Topics on this page:
Overview
The database to use after connecting.
See also: mariadb-shell for MariaDB Shell, in 23.02, in 23.01, in 22.12, and in 22.10
USAGE
mariadb-shell [{--database | --db | -d} <db_name>]
DETAILS
Option | Default Behavior | Argument |
---|---|---|
--database --db -d | If omitted, no database is selected for use after a successful connection | Database name |
EXAMPLES
To set the database named test
as the current database after a successful connection:
$ mariadb-shell \
--host 192.0.2.1 \
--user user_name \
--password 'user_password' \
--database test
To use the short option names, the equivalent command is:
$ mariadb-shell \
-h 192.0.2.1 \
-u user_name \
-p 'user_password' \
-d test
After a successful connection, MariaDB Shell's prompt will display the currently used database in parentheses ()
:
MariaDB (test) »
CHANGE HISTORY
Release Series | History |
---|---|
23.03 |
|
23.02 |
|
23.01 |
|
22.12 |
|
22.10 |
|