In this tutorial, We are going to cover, Select Database in MySQL using command line.
First login to MySQL using with UserName and password.
$ mysql -u username -p
To specify the database to use in MySQL, The USE DATABASE statement is applicable in cases where several databases exist in a MySQL server.
Syntax:
USE database_name;
Example:
In this example, let’s name the database “movies”.
mysql> USE movies;
Output:
mysql> use movies; Database changed