Last active
July 16, 2017 12:52
-
-
Save bardware/0466c32c559911dcb2e88a416b5733d3 to your computer and use it in GitHub Desktop.
Import tweets.csv into MySQL DB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `tweets` ( | |
`tweet_id` bigint(11) NOT NULL, | |
`in_reply_to_status_id` bigint(11) NOT NULL, | |
`in_reply_to_user_id` bigint(11) NOT NULL, | |
`timestamp` varchar(100) COLLATE utf8mb4_german2_ci NOT NULL, | |
`source` varchar(4000) COLLATE utf8mb4_german2_ci NOT NULL, | |
`text` varchar(4000) COLLATE utf8mb4_german2_ci DEFAULT NULL, | |
`retweeted_status_id` bigint(11) DEFAULT NULL, | |
`retweeted_status_user_id` bigint(11) DEFAULT NULL, | |
`retweeted_status_timestamp` bigint(11) DEFAULT NULL, | |
`expanded_urls` varchar(4000) COLLATE utf8mb4_german2_ci DEFAULT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_german2_ci | |
LOAD DATA LOCAL INFILE 'tweets.csv' INTO TABLE tweets FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '' LINES TERMINATED BY '\n'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment