当前位置:网站首页>【批量更改mysql表以及表中字段对应的编码】
【批量更改mysql表以及表中字段对应的编码】
2022-04-23 05:55:00 【ZHZHK001】
批量更改mysql表以及表中字段对应的编码
--01、查询所有的表
select * from information_schema.`TABLES` where TABLE_SCHEMA = '数据可名称';
--02、复制表到excel中,通过excel生成多行语句
--03、执行修改
alter table `表1` convert to character set utf8;
alter table `表2` convert to character set utf8;
alter table `表3` convert to character set utf8;
--…………
以下是参考资料中抄录整理的
--修改表的编码格式的
ALTER TABLE `table` DEFAULT CHARACTER SET utf8;
--虽然修改了表的编码格式,但是字段的编码格式并没有修改过来,没有什么卵用
--此方法与使用navicat更改表的编码是类似的
--修改字段的编码格式
ALTER TABLE `tablename` CHANGE `字段名1` `字段名2` VARCHAR(36) CHARACTER SET utf8 NOT NULL;
--但是一次只能修改一个字段,比较麻烦。
--修改一张表的所有字段的编码格式,表与字段同时更改
alter table `tablename` convert to character set utf8;
--相当的方便
参考资料:https://www.cnblogs.com/marx-luo/p/6713107.html
谢谢!
版权声明
本文为[ZHZHK001]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43142925/article/details/122602609
边栏推荐
- 金额输入框,用于充值提现
- C语言结构体指定初始化
- el-table添加序号
- The difference between single quotation mark, double quotation mark and back quotation mark in shell script
- Node accesses server-side static resources
- 监听除某元素之外点击事件
- Assembler 32-bit unsigned addition calculator
- 查漏补缺(四)
- Wildcards and special symbols for shell scripts
- 颜色字符串转换
猜你喜欢
![[UDS unified diagnosis service] i. diagnosis overview (1) - diagnosis overview](/img/c5/4b3092daeabf0f4889d93fef327c88.png)
[UDS unified diagnosis service] i. diagnosis overview (1) - diagnosis overview

js根据名字将数组对象中名字相同的项组成一个相同的数组
VHDL-任意分频器(50%占空比)

Running QT program in visual Stdio

Eigen 学习总结

FOC single resistance sampling position loop control servo motor

汇编 32位无符号加法计算器

FOC 单电阻采样 位置环控制伺服电机

Analysis and setting of dead time

【ES6】 Promise相关(事件循环,宏/微任务,promise,await/await)
随机推荐
VHDL arbitrary frequency divider (50% duty cycle)
如何使用input表单向服务发送(占用较小)图片文件(body传输)?涉及到FileReader内置对象
20220222回归职场
Shell脚本 单引号、双引号和反引号的区别
特效案例收集:鼠标星球小尾巴
SQLite compilation
Use of C language and
Mysql中的索引与视图
C语言代码规范
Multibyte and Unicode in VS
MOS tube characteristics and conduction process
[UDS unified diagnosis service] i. diagnosis overview (1) - diagnosis overview
Node accesses server-side static resources
Error in created hook: “ReferenceError: “Promise”未定义“
Palindromic Primes
FOC电机库 定点PID代码分析
Incremental update of client software
HDU-Memory Control
元素计算距离与event事件对象
2022LDU寒假训练-程序补丁