当前位置:网站首页>sqlserver 数据传输到 mysql
sqlserver 数据传输到 mysql
2022-04-22 09:15:00 【游戏编程】
查看mysql和sqlserver数据库的默认编码方法
mysql:
show variables like 'character_set_%';
show variables like 'collation_%';
sqlserver:
SELECT COLLATIONPROPERTY('Chinese_PRC_Stroke_CI_AI_KS_WS', 'CodePage')
下面是查询结果:
936 简体中文GBK
950 繁体中文BIG5
437 美国/加拿大英语
932 日文
949 韩文
866 俄文
65001 unicode UFT-8
中文占字节数
GBK的文字编码是双字节;
UTF-8编码则,中文使用24位(三个字节)来编码;
sqlserver 单用户与多用户切换方式:
执行SQL ALTER DATABASE db_database SET SINGLE_USER WITH ROLLBACK IMMEDIATE
修改为单用户模式
执行SQL ALTER DATABASE db_database SET MULTI_USER
再修改为多用户模式
创建字符集为gbk的mysql数据库:MYSQL创建utf-8格式的数据库先mysql进入:代码GBK: create database test2 DEFAULT CHARACTER SET gbk COLLATE gbk_chinese_ci;UTF8: CREATE DATABASE `test2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;[root@linuxtest test]# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.1.30-community MySQL Community Server (GPL)Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> CREATE DATABASE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;Query OK, 1 row affected (0.06 sec)mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || cacti || mysql || test | |+--------------------+5 rows in set (0.07 sec)这个test库就是utf-8格式的
对于字符编码格式不一致的数据传输问题:【sqlserver gbk编码,mysql utf8编码】
解决思路:新建一个mysql数据库,gbk编码,然后再通过数据传输,将数据传输到utf8编码的mysql数据库中
将一个表的数据插入到另一个表中
insert into tb_grade (GradeName,NClassId) SELECT g.`GradeName`, cg.`NClassID`FROM `grade` gINNER JOIN `classgrade` cg ON cg.`ClassGradeType`=g.`ClassGradeType`order by NClassId, GradeId asc
作者:冬月二四
游戏编程 ️,一个游戏开发收藏夹~
如果图片长时间未显示,请使用Chrome内核浏览器。
版权声明
本文为[游戏编程]所创,转载请带上原文链接,感谢
https://www.233tw.com/career/118595
边栏推荐
- Stream API optimization code
- 微搭低代码零基础入门课
- Flink流处理引擎系统学习(一)
- Gym member management system requirements analysis document
- L2-004 search tree judgment
- PHP & Laravel & 掌握 api 生成 token 的几种方式以及一些注意事项(坑)
- Flink流处理引擎系统学习(三)
- unity之动态批处理和静态批处理
- [image steganography] fixed neural network steganography: train the images, not the network
- 2022 R1 quick opening pressure vessel operation exercises and online simulation examination
猜你喜欢

从科普、医生培训及创新医械产品推广需求出发,「佰医绘」如何布局医学可视化SaaS服务?

ERP 集成对公司系统完善的重要性

运维数据该如何防泄露

分布式场景业务操作日志实现(基于redis轻量)

Leetcode0396. Rotation function (medium, iteration)

MySQL进阶之视图

Reverse linked list II

R语言进阶|广义向量和属性解析

Redis 内存回收策略

2022 high altitude installation, maintenance and demolition of special operation permit examination question bank and simulated examination platform operation
随机推荐
pytorch模型加载跑测试集和训练过程中跑测试集结果不一致的问题?
The bare metal machine developed by single chip microcomputer can also "multitask"?
A 2500 word article will take you to understand the basic knowledge of performance testing
Neo4j: merge [create if it doesn't exist, modifiable if it already exists]
智能手表的突破和新发展机遇
ANSI标准库中的time.h头文件
APP优化及积分榜进阶下篇【MUI+Flask+MongoDB】
MSE upgrade, the next stop of cloud native microservices
Flink流处理引擎系统学习(三)
C#导入详细内容
Halo 开源项目学习(一):项目启动
使用docker搭建适合thinkphp5的lnmp+redis开发环境
分隔链表(建两个空链表)
echo “新密码”|passwd --stdin 用户名
建议:块引用排序按照关键词的顺序排序
onenet云平台数据推送到数据库
如何构建一个可“持续演进”的可观测体系?| QCon
电脑拆机清灰及机械硬盘安装记录
【图像隐写】Fixed Neural Network Steganography: Train the images, not the network 整理
Cmake使用基础知识一之基础语法