Giter VIP home page Giter VIP logo

import_csv_to_mysql_db's Introduction

import_csv_to_mysql_db

import_csv_to_mysql_db

go run main.go --table=t1 --host=192.168.0.170 --user=xzx --password= --dbname=mysqlslap --csvPath=/root/t12.csv

mysql> show create table t1;

CREATE TABLE t1 (
intcol1 int(32) DEFAULT NULL,
charcol1 varchar(128) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

mysql> show create table tmp_log;

CREATE TABLE tmp_log (
day date DEFAULT NULL,
logid bigint(20) DEFAULT NULL,
accout varchar(225) DEFAULT NULL,
action varchar(225) DEFAULT NULL,
cd varchar(50) DEFAULT NULL,
collectmark varchar(50) DEFAULT NULL,
cookie varchar(50) DEFAULT NULL,
disp varchar(50) DEFAULT NULL,
domain varchar(500) DEFAULT NULL,
executiontime bigint(20) DEFAULT NULL,
ip varchar(50) DEFAULT NULL,
lang varchar(50) DEFAULT NULL,
product varchar(50) DEFAULT NULL,
query varchar(50) DEFAULT NULL,
referrer text,
sh int(11) DEFAULT NULL,
sw int(11) DEFAULT NULL,
target varchar(500) DEFAULT NULL,
title varchar(2000) DEFAULT NULL,
url varchar(5000) DEFAULT NULL,
useragent varchar(2000) DEFAULT NULL,
userinfo varchar(2000) DEFAULT NULL,
version varchar(20) DEFAULT NULL,
xpath varchar(1000) DEFAULT NULL,
KEY inx_day (day)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

go run main.go --table=tmp_log --host=192.168.0.170 --user=root --password=123456 --dbname=mysqlslap --csvPath=/root/12.txt

二进制文件执行方式

csv2MySQL

./csv2MySQL --table=t1 --host=192.168.0.170 --user=xzx --password= --dbname=mysqlslap --csvPath=/root/t12.csv

import_csv_to_mysql_db's People

Contributors

xingzhenxiang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.