生成sql格式(将qdm723412313_db改为你的数据库名称即可):
SELECT concat( 'alter table ', table_name, ' engine=InnoDB CHARSET=utf8mb4; ' ) FROM information_schema.TABLES t WHERE table_schema = 'qdm723412313_db' AND table_type = 'base table';
生成数据如下:
alter table cmf_user engine=InnoDB CHARSET=utf8mb4; alter table think_ad engine=InnoDB CHARSET=utf8mb4; alter table think_ad_type engine=InnoDB CHARSET=utf8mb4; alter table think_admin engine=InnoDB CHARSET=utf8mb4; alter table think_admin_log engine=InnoDB CHARSET=utf8mb4; alter table think_answer_question engine=InnoDB CHARSET=utf8mb4; alter table think_article engine=InnoDB CHARSET=utf8mb4; alter table think_auth_group engine=InnoDB CHARSET=utf8mb4;
然后再复制执行即可
例如我们需要查询商品表中每个分类中商品id最大的记录,并且显示商品价格以下是表结构:id catename title &nb...
1.查看所有表,包括视图表,show tables;2.查看表结果,包括视图表,desc 表名3.查看建表过程,show create table 表名;4.查看建视图过程,show create view...
1.MyISAM 建立一个MyISAM引擎的表时,就会在本地磁盘上建立三个文件,.frm格式文件,存储表定义;.MYD格式文件,存储数据;MYI格式文件,存储索引;方便数据迁移,我只需将mysql安装目录下data文件中的表文件复制即可完成数据迁移,之前在搬迁多个dedecms中深有体会。 ...
1.floor(x)返回小于x的整数,向下取整,用法,商品的价格是浮点型的,需要向下取整 eg:select id,title,floor(price) from shopgoods2.rand()返回0-1之间的随机数 select rand() select rand()...
1.查看歌曲表结构(主要是给name字段添加全文索引)(mysql5.7才支持全中文索引)desc music; +---------+-------------+------+-----+---------+----------------+ | Fie...
项目中查询数据部分字段出现null,影响到了排序,但是由于没有数据库权限,还想将null转为其他值表示;例如现有表member的原始数据:SELECT * FROM memberid &n...