Database __MySQL

2019.5.28:

 

Learning Content:

#########################################################################

 

MySQL

MySQL is a relational database using SQL language CRUD operations, currently part of Oracle's products.

Free open-source MySQL database, cross-platform, distributed support, performance is also good, and can be PHP, Java and other Web development languages ​​perfect fit, ideal for small and medium businesses as a Web Database (site database).

 

 

create DATABASE [IF NOT EXISTS] <数据库名>[[DEFAULT] CHARACTER SET <字符集名>] [[DEFAULT] COLLATE <校对规则名>];  

  [ ]The content is optional. Syntax is as follows:

  • <Database name>: Create a database name. MySQL's catalog will indicate how the data storage area MySQL database, the database name must conform to the operating system folder naming conventions, pay attention to case-insensitive in MySQL.
  • IF NOT EXISTS: judge before creating a database to perform the operation only if the database does not yet exist. This option can be used to avoid repeating mistakes and create the database already exists. Do not allow the same system with two names database.
  • [DEFAULT] CHARACTER SET: Specifies the default character set of the database.
  • [DEFAULT] COLLATE: default collation specified character set.

  Note: two different concepts MySQL character set (the CHARACTER) and collation (the COLLATION): used to define the character set is stored in a manner MySQL string collation string comparison is defined manner, in sorting and grouping of characters problem. Character set and collation are many relationship, each corresponding to at least one character set collation, MySQL supports nearly 200 kinds of collation 39 kinds of character sets.

 

 

  To prevent confusion of the characters happens, MySQL sometimes need to explicitly specify the character set when creating a database; in mainland China, commonly used character set utf8 and gbk.

  • All utf8 characters can be stored around the world, can be used in any country, the default collation is utf8_general_ci, for the Chinese may use utf8_general_ci.
  • Gbk Chinese character can only store involved, does not have a universal character, the default collation is gbk_chinese_ci.

Guess you like

Origin www.cnblogs.com/marvintang1001/p/10935245.html