
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: test-mysql2_development
pool: 5
username: root
password:
socket: /tmp/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: test-mysql2_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: test-mysql2_production
pool: 5
username: root
password:
socket: /tmp/mysql.sock
一、针对批量插入数据,如果量不是太多,可以多条SQL语句运行就可以了,
类似下面的语句,当然可以使用excel 编辑后,复制到查询器中运行,
insert into table(a,b) values('1','a')
insert into table(a,b) values('2','b')
insert into table(a,b) values('3','c')
二、大量数批量插入,即数据表的移植,数据备份转换之类的,就需要工具,比如MSSQL的DTS工具,pb的数据通道 等等。这里介绍一下 DTS工具。
1、在SQL安装目录下开启导入和导出数据,即DTS。
2、选择一个批量的数据,可以是表,也可以是带分隔符的文件,或excel文档之类,如图中选择,导入的格式
3、选择导入的目标
4、选择导入方式
5.具体的导入规则
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)