Cd/var/lib/mysql/game
ll
Vim db.opt
Default-character-set=utf8
Default-collation=utf8_general_ci
Wq
Service mysqld Restart
Or
Service Mysqld Reload
Default Character Set modification complete
Vim/etc/my.cnf
[Mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
Default-storage-engine=innodb #添加该行 Set the default engine to InnoDB
Service mysqld Restart
Default Engine modification Complete
Mysql> show engines; #查看搜索引擎
Specify search engines and characters when you build a table
Mysql> CREATE TABLE T2 (id int) Engine=innodb default CharSet =utf8;
InnODB The engine supports many features:
a) support for ACID, simply to support transactional integrity, consistency;
b) support for row locks, as well as consistent reads like ORACLE, multiuser concurrency;
c) unique clustered index primary key design method, can greatly improve concurrent read and write performance;
d) support for foreign keys;
e) support crash data self-healing;
InnoDB for:
1. Applications that require transactions
2. Highly concurrent applications
3. Automatic recovery
4. Faster primary key-based operations
Need for attention issues
a) all InnoDB Data Sheets Create a non-business-independent, self-increment digital type as the primary key, which is very helpful to ensure performance;
b) to eliminate the use of Text/blob, do need to use, as far as possible to split out into a separate table;
c) Timestamp is recommended to use TIMESTAMP type storage;
d) IPV4 addresses are recommended to be stored in INT UNSIGNED type;
e) non-logical, such as gender, it is recommended to use TINYINT storage instead of CHAR (1);
f) storing longer text content, it is recommended to use json/bson format storage;
Modify MySQL default character set, default engine