mirror of
https://github.com/OpenFusionProject/scripts.git
synced 2024-11-14 19:20:05 +00:00
Fix for large packet size
This commit is contained in:
parent
8b1bd5b1ee
commit
9fd6441606
@ -141,19 +141,31 @@ def main(conn, xdt_path):
|
|||||||
process_xdt_table(cursor, root, table_name, mappings)
|
process_xdt_table(cursor, root, table_name, mappings)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
def connect_to_db():
|
||||||
|
return mysql.connector.connect(
|
||||||
|
host="localhost",
|
||||||
|
user="root",
|
||||||
|
password="mypassword",
|
||||||
|
database="tabledata"
|
||||||
|
)
|
||||||
|
|
||||||
|
def prep_db():
|
||||||
|
conn = connect_to_db()
|
||||||
|
cursor = conn.cursor()
|
||||||
|
cursor.execute("SET GLOBAL max_allowed_packet=1073741824")
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
print("Usage: python3 json2xdb.py <path to xdt file>")
|
print("Usage: python3 json2xdb.py <path to xdt file>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
xdt_path = sys.argv[1]
|
xdt_path = sys.argv[1]
|
||||||
conn = mysql.connector.connect(
|
prep_db()
|
||||||
host="localhost",
|
conn = connect_to_db()
|
||||||
user="root",
|
|
||||||
password="mypassword",
|
|
||||||
database="tabledata"
|
|
||||||
)
|
|
||||||
main(conn, xdt_path)
|
main(conn, xdt_path)
|
||||||
|
conn.close()
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user