Database-About the database engine
-- 主要用的
/*
INNODB 默认使用
MYISAM 早些年使用
*/
INNODB | MYISAM | |
---|---|---|
Transaction support | stand by | not support |
Data row lock | stand by | not support |
Foreign key constraint | stand by | not support |
Full-text index | not support | stand by |
Table space size | Larger (about twice MYISAM) | Smaller |
Transaction support: assuming that two databases are executed at the same time, either both succeed or both fail
Data row lock: INNODB is a data row lock, MYISAM is a data table lock, so INNODB is more efficient than MYISAM
MYISAM: save space and speed
INNODB: high security, support transaction processing, multi-table multi-user operation
The location in the physical space of the database
All database files are stored in the data directory, the essence of which is the storage of files, a folder corresponds to a database
The difference between MYSQL engine storage on physical files
- INNODB has only one .frm file in the database table and the ibdata1 file in the upper directory
- File corresponding to MYISAM
- .frm file: the definition file of the table structure
- .MVD files: data files
- MYI file: index file
Set the character set encoding of the database table
CHARSET=utf8 -- 在语句最后加上
If not set, it will be MYSQL's default character set encoding Latin1 (Chinese is not supported)
You can also configure the default encoding in the my.ini file
character-set-server=utf8
But it is not recommended, because if your database is used on someone else's computer, but it is not configured, there will be problems.