51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

mysql 数据库存储引擎相关命令

mysql 数据库存储引擎相关命令

查看数据库可用存储引擎

mysql> show engines;

查看数据库默认存储引擎

mysql> select @@default_storage_engine;

永久修改存储引擎配置

[root@xiaoQ-01 ~]# vim /etc/my.cnf
default_storage_engine=InnoDB
-- 重启数据库服务生效

查看建表语句获取存储引擎信息

mysql > show create table city;

查看information_schema数据库获取存储引擎信息:

select table_schema,table_name,engine from information_schema.tables where table_schema not in('sys','mysql','information_schema','performance_schema');

数据表存储引擎配置修改:(具体表的存储引擎)

# 创建表时设置存储引擎
mysql > create table xxx (id int) engine=innodb charset=utf8mb4;
​
# 修改表示设置存储引擎
mysql > alter table world.xxx engine=myisam;
mysql > alter table world.xxx engine=innodb;
赞(1)
未经允许不得转载:工具盒子 » mysql 数据库存储引擎相关命令