Press "Enter" to skip to content


MySql Select Databases - Open Database command

MySql Select databases command , If you want to open database and Open databases at the command line. Use command will help you complete the task.

Another case when you have more then one database and you want to swtich the database ,Example two database DB1 ,DB2 .

use DB1;

DB1 will open ,and ready for all command.

Now switch to DB2,

use DB2,

Now DB1 is closed and DB2 is open for command.

MySQL  ‘USE  ‘ command to open database at the command line. The following example will open the database.


             use  <Database name>

Example for Open Database 'USE' Command

mysql> use w3htmlschool;
Database changed


Output of use command in MYSQL

mysql> use w3htmlschool;
Database changed

Above command open the database at command line.

use – is the mysql systax

<Database name> – is the name of the database ,which we want to open .