Rookie rise DB Chapter 3 basic operation of MySQL 5.6

Source: Internet
Author: User

3 Basic operation of MySQL

Above we learn how to install a database, then this section we come to know the database;

we are after MySQL installation, in the data directory will automatically generate several necessary databases, you can use SHOW DATABASES Statement to query the current database of all existing (note that the query results and permissions are related, if there is no login then can only query to the first and fourth):

where MySQL is a must, he describes the user access rights, users often use the test database to do the work of testing. Creating a database is essentially dividing a region on disk for data storage and management, which can be used directly if the administrator creates a database for the user when setting permissions, otherwise it is necessary to create the database yourself. Let 's take a look at MySQL creation.

3.1 creating databases, viewing databases and database definitions

all operations on the data are database-based, so creating a database is our contact One of the most basic operations of DB, the syntax for creating a database is as follows:

CREATE DATABASE db_name;

Practice

CREATE DATABASE test_db;

Show databases;// View Database

Show CREATE database test_db;// view DB definition

3.2 Deleting a database

Deleting a database is a very cautious thing, because Deleting a database does not give you any hints, and deleting the database will remove all data from the database and not restore .

The database has been deleted

SHOW CREATE DATABASE test_db;

The database definition cannot be queried at this time

3.3 Selecting a database

Above we learn the deletion and switching of the database, then if you switch to use the database, fake into you suddenly need to go to another database to operate it?

Use MySQL;

Rookie rise DB Chapter 3 basic operation of MySQL 5.6

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.