1

我试图在 MySQL 数据库中插入许多行,由于某种原因,我总是收到此错误。我已经尝试过本主题中的解决方案,但没有任何效果。

TypeError: not enough arguments for format string

我的代码:

cursor = db.cursor()

        row = (date, timetoserve, ipcliente, cacheCode, bytesint, method,\
        url.scheme, url.hostname, url.port, url.path, auth, route[0], route[1], contentType)

        items.append(row)

        if Inputs % 100 == 0:
                sql = "INSERT INTO LogTbl \
                (DateConnection, TimeToServe, ClientIP, CacheCode, Bytes, Method,\
                RequestProtocol, RequestIP, RequestPort, RequestFolder, Auth, RouteLeft, RouteRight, ContentType)\
                VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"

            cursor.executemany(sql, items)
            items = []
            db.commit()
4

0 回答 0