MySQL Notes: Database operations

Source: Internet
Author: User
Tags advantage

First, create a database

Create and display a database that already exists.

CREATE DATABASE MySQLdb; SHOW DATABASES;


Second, delete the database

Deletes and displays the database that already exists.

DROP DATABASE MySQLdb; SHOW DATABASES;

Third, the database storage engine

The storage engine refers to the type of table, the storage engine of the database determines how the table is stored on the computer, and can choose different storage methods depending on the requirements.

When you create a table, InnoDB is selected by default if you do not specify a default storage engine.

    • The InnoDB engine supports auto-grow columns and foreign keys, the table structure is stored in the frm file, and the data and the lasso are stored in the table spaces defined by Innodb_data_home_dir and Innodb_data_file_path. The advantage lies in providing good transaction management, crash repair ability and concurrency control, the disadvantage is that the reading and writing efficiency is slightly poor, occupy data space is large.
    • The table structure of the MyISAM engine is stored in the frm file, the data is stored in the MyD file, and the lasso is stored in the Myi file. The advantage is the small footprint, fast processing speed, the disadvantage is that transaction integrity and concurrency are not supported.
    • The memory engine creates tables using content that is stored in the contents, except that the table structure is stored in the frm file, and the rest of the data is stored in memory. This helps to improve the efficiency of the table, freeing the memory or deleting the table when it is no longer needed.

MySQL Notes: Database operations

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.