
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Is it necessary to select the database each time we begin a MySQL session?nHow can it be done?
The database is created only once but it is necessary to select it each time we begin a MySQL
session. It can be done with the help of USE db_name statement on MySQL command line tool.
mysql> Use Query; Database changed
It shows that we are now using query database.
We can also select the database while invoking the MySQL from Windows command line. It can be done with the help of the following command −
C:\Program Files\MySQL\bin>mysql -u root -p query Enter password: *****
Here, query is the name of the database we are going to use for current MySQL session
- Related Articles
- Autoincrement in MySQL begins from 1? How can we begin it from another number?
- Can we select row by DATEPART() in MySQL? Is it possible?
- How can we select a MySQL database by using PHP script?
- What is the meaning of “SELECT” statement in MySQL and how can it be used?
- After connecting to MySQL server how can we select a database from\ncommand prompt?
- Is it necessary to add DEFAULT NULL in MySQL?
- How can it be possible to invert a string in MySQL?
- How can we change the default MySQL database to the given database?
- Is it necessary to have a responsive website?
- Select current time with MySQL now() and convert it to GMT 0?
- How is Session Management done in JSP?
- How can we drop a MySQL view from the database?
- What is ginning? How is it done?
- What is MySQL UNIQUE constraint and how can we apply it to the field of a table?
- Insert the results of a MySQL select? Is it possible?

Advertisements