MySQL Concepts and common commands

Source: Internet
Author: User

Database common commands;

View database: show databases;

Creating a database: Create databases database_name;

Delete database: drop databases database_name;

MySQL-supported engine; show engines \g;

Shows the storage engine supported by the database; Show variables like ' have% ';

Using the database: use database_name;

Displays the contents of the database: show CREATE DATABASE database_name \g;

Show the created data table; show tables;

View table detail Structure statement; Show CREATE table Tb_emp \g;

View the structure of the table desc TB_EMP1;

============================= Database Concept ============================

SQL (Structured Query language)

Data Definition Language DDL

Data Manipulation Language DML

Data Control Language DCL

INFORMATION_SCHEMA: Some database object information in the primary storage system, such as user table information, column information, permission information, character set information and partition information, etc.

Performance_schema: Primary Storage database service performance parameters.

MySQL: User rights information for the primary storage system.

Test: Tests the database, which can be used by any user.

The database name consists of letters, numbers, underscores, @, #, and $, where the letters can be a~za~z, or they can be letters and characters in other languages.

The first letter cannot be a number and the $ identifier is not allowed to be a reserved word for MySQL. Spaces and special characters are not allowed. The length is less than 128.

Storage engine;

MyISAM storage engine; Access is faster because the storage engine does not support things and does not support foreign keys. Therefore, there is no requirement for the integrity of things and access-oriented applications are suitable for the storage engine.

InnoDB storage engine; Because the storage engine has an advantage in things, which is to support the installation of things with commit, rollback, and crash resiliency, it consumes more disk space than the MyISAM storage engine.

As a result, frequent updates and deletions are required, as well as a high level of integrity requirements, requiring concurrency control, which is appropriate for the storage engine.

Memory storage engine, the storage engine stores data by using RAM, so the storage engine has a fast data access, but security is not guaranteed.

If the data involved in the application is small and requires quick access, it is appropriate for the storage engine.

MySQL Concepts and common commands

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.