Learn basic operations of MYSQL3---database from scratch

Source: Internet
Author: User

  • Create a database
    • Once the MySQL installation is complete, you will automatically create a few required databases in its data directory to use show DATABASES to view the currently existing database
    • Creating a database is a partition of the system disk for data storage and management, which can be used directly if the administrator creates a database for the user when setting permissions. Otherwise, you need to create your own database
    • Basic SQL syntax format for creating databases: creat database database_name;
  • Deleting a database
    • Deleting a database clears the existing database from disk, and all data in the database is deleted together
    • Basic SQL syntax format for deleting databases: DROP database database_name
    • Use the drop Database command with great care, and when the command is executed, MySQL does not give any reminder acknowledgement, and the drop database declares that all data tables and data stored in the database will be deleted together.
  • The database storage engine is the database underlying software component, and the database management system uses the data engine to create, query, update, and delete data operations. The core of MySQL is the storage engine.

    You can use the show ENGINES statement to view the engine types supported by the system default means that the engine is the current

    • InnoDB Storage Engine
      • Provides a secure storage engine for things with commit, rollback, and crash resiliency
      • is designed to handle the maximum performance of large volumes of data
      • Fully integrated with MySQL server
      • Support for FOREIGN key integrity constraints
      • be used in many large database sites that require high performance
    • MyISAM Storage Engine
      • Large files are supported on file systems and operating systems that support large files
      • dynamic-size lines produce less fragmentation when deleting and updating and inserting operations are mixed
      • The maximum number of indexes per MyISAM table is 64, which can be changed by recompiling. The maximum number of columns per index is 16
      • The maximum key length is 1000 bytes, which can also be re-compiled to change
      • The Blob and text columns will be used
      • Null value is allowed in the column of the index
      • All numeric keys are stored in the highest byte priority to allow a higher index compression
      • Auto_increnent column updates for each MYISAM type table are faster
      • Data files and index files can be placed in different directories
      • Each character column can have a different character set
      • The flag with varchar can be fixed or dynamically recorded length
      • varchar and char columns can be up to 64KB.
    • Memory Storage Engine
        • Each table can have 32 indexes, 16 columns per index, and a maximum key length of 500 bytes
        • Executing hash and Btree indexes
        • You can have non-unique keys in a table
        • Use a fixed-length format
        • Blob and text columns are not supported
        • Supports auto_increnent columns and indexes that can contain null-worthy columns
        • Shared between all clients
        • Content is present in memory, memory is momory table and server is idle during query processing, internal table sharing created
        • When the memory table is not in need of the content, to release the memories used by the storage table, to execute the delete from or TRUNCATE table or delete the entire table (drop table)

Learn basic operations of MYSQL3---database from scratch

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.