1、数据表结构的搬家
SqlServer的建表sql语句在MySQL中肯定不能运行
这里使用转换工具
下载地址:
https://download.csdn.net/download/zhutouaizhuwxd/10519813
使用说明:
https://www.cnblogs.com/miantiaoandrew/p/7511834.html
需要注意的是:视图并不能从sqlserver转换过来,需要在MySQL中手动建立
2、MySQL导出表结构和数据
MySQL是可以把表结构和视图一起导出到sql脚本的
需要注意的是:
如果现有有三个视图,编号1、2、3
第1个视图依赖第2个视图,也就是需要先执行视图2,才能执行视图1,
需要在导出的sql脚本中,手动更换创建视图的前后位置,不然执行不了
3、执行SQL脚本中文乱码
在MySQL安装路径下,找到my.ini文件,
有的是mydefault.ini,就把mydefault.ini复制(复制)一份,改名为my.ini,
增加client标签,配置编码格式为utf8,在mysqld标签下配置编码utf8,如下图红色字体所示:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
default-character-set=utf8
[mysqld]
character_set_server=utf8
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = D:\mysql-5.6
datadir = D:\mysql-5.6\data
# port = .....
# server_id = .....
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES