Select Database from MySQL Command Prompt



Once we get connected to the MySQL server, it is required to select a database to work with. This is because there might be more than one database available with the MySQL Server.

It is very simple to select a database from the mysql> prompt. We can use SQL command ‘use’ to select a database. To illustrate it we are selecting the database named ‘Tutorials’ in the following example −

Example

[root@host]# mysql -u root -p
Enter password:******
mysql> use TUTORIALS;
Database changed
mysql>

Now, we have selected the TUTORIALS database and all the subsequent operations will be performed on the TUTORIALS database.

Updated on: 2020-06-20T13:42:08+05:30

144 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements