Load csv into mysql using Python syntax error -
This question and an answer is already here is:
- 1 answer
I TSV file has the following structure:
before the storm #DAteTime User ID View (divided from each \ t) 2009-06-07 02:07:41 http://twitter.com/hokiepokie728 @ fabro84 '' There is a new song from the Jonas Brothers that is going to be on their new album. Miley is a duet with Nick! 2009-06-07 02:07:42 'http://twitter.com/annieng' is now in
How can I import this file into a MySQL table which is < Code> tweet with dragon?
1 DT dated 2 user varchar (141) 3 to varchar (141) 4 ID bigint (20) AUTO_INCREMENT
the mysql- connector-Python 1.2.2 as you can do it like this
import mysql Are there. CNX Connector Import ClientFlag from mysql.connector.constants = mysql.conector.connect (client_flags = [ClientFlag.LOCAL_FILES], ....) CUR = cnx.cursor () cur.execute ( "data load local INFILE '& lt; / Path / per / data / file & gt; "INTO" "Table Tweet")
Comments
Post a Comment