使用熊猫将.csv保存到MySQL表

时间:2020-09-14 14:39:23

标签: python mysql pandas csv

我有以下python代码:

import pandas as pd
path = 'C: \\ Users \\ dorbezo \\ Documents \\ Python Scripts \\ datasur \\ data.csv'
e = pd.read_csv (path, sep = ',');

哪个给我一张04列的表格。

我希望将它们插入到现有表中,或者使用相同的代码创建一个表。

凭据:

url = "jdbc: mysql: //192.168.1.99/digemid? useUnicode = true & useJDBCCompliantTimezoneShift = true & useLegacyDatetimeCode = false & serverTimezone = UTC & zeroDateTimeBehavior = convertToNull"

properties = {
    "driver": "com.mysql.jdbc.Driver",
    "user": "dorbezo",
    "password": "Dorbezo123"
}

table = "registries_sanitarios_peru"

0 个答案:

没有答案