MySQL存储引擎

时间:2020-10-12 20:44:17   收藏:0   阅读:36
MySQL存储引擎(MySQL的“文件系统”)

zabbix用到的是tokudb三方引擎!该引擎支持多次数据的插入,性能不错

innodb功能总览(重点功能关注!):事务/锁定粒度 行/备份与恢复/自动故障恢复(理论上不怕突然断电,宕机等)

存储引擎查询
select @@default_storage_engine; //查看默认存储引擎
show engines; //还可以看到存储引擎是否支持事务
show create table city; //查看city表存储引擎
show table status like ‘city‘\G
select table_schema,table_name,engine from information_schema.tables where table_schema=‘world‘;
select table_schema,table_name,engine from information_schema.tables where table_schema=‘mysql‘;
select table_schema,table_name,engine from information_schema.tables where engine=‘csv‘;

存储引擎设置
1、在启动配置文件中设置服务器存储引擎:
[mysqld]
default-storage-engine=<Storage Engine>
2、使用 SET 命令为当前客户机会话设置:(临时) //临时的,这种很少用到!
SET @@storage_engine=<Storage Engine>;
3、在 CREATE TABLE 语句指定: //建表的时候定义存储引擎,这是常用方法!
CREATE TABLE t (i INT) ENGINE = <Storage Engine>;

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!