温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

mysql查看修改

发布时间:2020-07-18 07:33:12 来源:网络 阅读:435 作者:qq5a45086fc061a 栏目:MySQL数据库

一、查看引擎
1、 查看 mysql 引擎
1
SHOW ENGINES;
2、查看表引擎,方法一
SHOW TABLE STATUS from 数据库库名 where Name='表名';
1
SHOW TABLE STATUS from mytest where Name='test';
3、查看表引擎,方法二
mysqlshow -u 数据库登录帐号 -p '数据库登录帐号密码' --status 数据库库名 表名
1
mysqlshow -uroot -p123456 --status mytest test;

二、修改
1、方法一
1
2
alter table tt7 engine=innodb;
alter table tt7 engine=myisam;
2、方法二
1) 创建个和tt7同样表结构的表
1
create table tt7_tmp like tt7;
2) tt7_tmp作为中间结果集
1
insert into tt7_tmp select from tt7;
3) 删除原表的数据
1
truncate table tt7;
4) 这回更改原表的存储引擎
1
alter table tt7 engine=innodb;
5) 再把中间结果集的数据导回原表中
1
insert into tt7 select
from tt7_tmp;
6) 删除中间表
1
drop table tt7_tmp;

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI