This is the 13th day of my participation in Gwen Challenge

Parsing of existing databases

  • Information_schema: Information about database objects, such as user information, column information, characters, and partitions
  • Performance_schema: Stores database server performance parameters
  • Mysql: stores database user permission information
  • Sys: available later than version 5.7. Simplifies the query of object information and performance parameters. It is viewable and can quickly obtain who used how many resources and who connected

Common character set

  • Utf8: Use one to four bytes to encode each character. A Chinese character is usually three bytes
  • Utf8mb4: Can store emoticons and complex Chinese characters

MySQL added the utF8MB4 encoding after 5.5.3. Mb4 stands for most Bytes 4, which is designed to be compatible with four-byte Unicode.

2. Fortunately, UTF8MB4 is a superset of UTF8, and no conversion is required except to change the encoding to UTF8MB4. Of course, to save space, utF8 is usually enough.

https://www.cnblogs.com/zhengwangzw/p/9407838.html
Copy the code

Create, view, switch, and delete databases

  • create database test;
  • show databases;
  • use mysql;
  • drop database test;

The storage engine

Data in MySQL is stored in files (or memory) using various techniques. Each of these technologies uses different storage mechanisms, indexing techniques, locking levels, and ultimately offers a wide range of different capabilities and capabilities. By choosing different technologies, you can gain additional speed or functionality that can improve the overall functionality of your application.

For example, if you’re working on a lot of temporary data, you might want to use an in-memory storage engine. The memory storage engine is capable of storing all table data in memory. Alternatively, you may need a database that supports transaction processing (to ensure that the data can be rolled back if the transaction fails).

These different technologies and their associated capabilities are called storage engines (also known as table types) in MySQL.

MySQL comes with a number of different storage engines by default, which can be set up in advance or enabled in MySQL server.

  • Storage Engine Classification
    • MyISAM: 5.5 default, no transaction support, no foreign key support, very fast access
    • INNODB: default after 5.5, transaction support, powerful, more disk space, lower efficiency
    • MEMORY: MEMORY. The access speed is very fast and insecure. Data will be lost when the server is shut down

Different tables in Mysql can specify different storage engines

The data type

  • classification
    • numeric
    • String type
    • Date time type
  • Common data types
    • double
    • char
    • varchar
    • text
    • blob
    • date
    • time
    • datetime
    • decimal