Home > Database > Mysql Tutorial > body text

mssql转换mysql的方法_MySQL

WBOY
Release: 2016-06-01 13:47:40
Original
780 people have browsed it

bitsCN.com

神秘小强&1943

 1.导表结构

  使用MySQL生成create脚本的方法。找到生成要导出的脚本,按MySQL的语法修改一下到MySQL数据库中创建该表的列结构什么的。

  2.导表数据

  在MSSQL端使用bcp导出文本文件:

  bcp "SELECT * FROM dbname.dbo.tablename;" queryout tablename.txt -c -Slocalhostdb2005 -Usa

  其中""中是要导出的sql语句,-c指定使用 进行字段分隔,使用进行记录分隔,-S指定数据库服务器及实例,-U指定用户名,-P指定密码.

  在MySQL端使用mysqlimport 导入文本文件到相应表中

  mysqlimport -uroot -p databasename /home/test/tablename.txt

  其中-u指定用户名,-p指定密码,databasename指定数据库名称,表名与文件名相同。

bitsCN.com
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!