Home > Database > Mysql Tutorial > body text

MSSQL转MYSQL,gb2312转utf-8无乱码解决方法

WBOY
Release: 2016-06-07 18:01:02
Original
1111 people have browsed it

MSSQL转MYSQL,gb2312转utf-8无乱码解决方法,需要的朋友可以参考下。

使用软件:MySQLMigrationTool


提示数据过大,无法导入。修改my.cnf文件的max_allowed_packet = 100M以上。在windows操作系统中,my.cnf有可能显示不出来,需要用编辑器直接输入地址:盘符:\目录mysql教程binmy.cnf打开。

“there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause”,MSSQL一个表中有两个以上的日期时间字段使用了getdate()取默认值,去掉即可。

“BLOB/TEXT column '表名' can't have a default value”,此字段不允许使用默认值,去掉即可。

“The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs”,此表字段占用空间太大,适当减少其字段数量或长度。

运行软件后,点NEXT进入以下界面:

选择MS SQL SERVER,按提示填写,Connection String为:

jdbc:jtds:sqlserver://IP地址:端口(默认1433)/数据库教程名;user=用户名;password=密码;charset=gb2312;domain=
Copy after login

下一步为MySQL的信息,Connection String为:

jdbc:mysql://IP地址:端口(默认3306)/?user=用户名&password=密码&useServerPrepStmts=false&<br>characterEncoding=UTF-8
Copy after login

之后一路按提示进行。到此界面选择要忽略的表。

继续NEXT,如图所示进入此界面,此处设定字符编码,非常关键。

mssql 导入 mysql 不乱码 MySQLMigrationTool
MySQL GUI Tools 5.0 包含了 MySQLMigrationTool 这个工具可以完成我们的任务
此工具需要JRE update 8 以上的支持,可以去sun.com下载,速度很快。
http://www.java.com/zh_CN/download/manual.jsp
有的同学运行后导入mysql的结果是中文乱码 , 那是由于在一路next的中间有一个
选择编码的步骤, 此处务必选 user defined ,填上 charset=gbk,coll...tion的等于
gbk_chinese_ci , 就是把latin,和swidish的修改下,改成中文相应的。总之这里要看好
否则乱码就怪不了别人了。

然后一路next就是了。。。。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!