show database in mysql code example

Example 1: mysql list databases

SHOW DATABASES;

Example 2: how to see database in mysql command line

mysql -u user -p

Example 3: how to show current database in mysql

CopySELECT database();

Example 4: mysql show create db

SHOW CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name

If the SHOW statement includes an IF NOT EXISTS clause, the output 
too includes such a clause. SHOW CREATE SCHEMA is a synonym for
SHOW CREATE DATABASE.

Example 5: how to see database in mysql command line

use DBNAME;

Tags:

Sql Example