mirror of
https://github.com/lucky-sideburn/kubeinvaders.git
synced 2026-08-22 21:16:31 +00:00
22 lines
438 B
Python
22 lines
438 B
Python
import time
|
|
import mysql.connector
|
|
|
|
# Connect to the MySQL database
|
|
cnx = mysql.connector.connect(
|
|
host="localhost",
|
|
user="root",
|
|
password="password",
|
|
database="test"
|
|
)
|
|
cursor = cnx.cursor()
|
|
|
|
# Continuously insert rows into the "test_table" table
|
|
while True:
|
|
cursor.execute("INSERT INTO test_table (col1, col2) VALUES (%s, %s)", (1, 2))
|
|
cnx.commit()
|
|
time.sleep(1)
|
|
|
|
# Close the database connection
|
|
cnx.close()
|
|
|