Answer the question
In order to leave comments, you need to log in
Transferring a table from mysql to ms sql using python?
made a connection to two databases that are on different hosts
import pymssql
import pymysql
SERVER = "server"
USER = "USER"
PASSWORD = "PASSWORD"
DATABASE = "DATABASE"
connection = pymssql.connect(server=SERVER, user=USER, password=PASSWORD, database=DATABASE)
cursor = connection.cursor()
cursor.execute("DELETE FROM cashier_receipt_copy1")
connection.commit()
connection = pymysql.connect(host='host',
user='user',
password='password',
db='db',
charset='utf8mb4',
cursorclass=pymysql.cursors.DictCursor)
cur = connection.cursor()
cur.execute("SELECT * FROM trm_in_users")
for row in cur.fetchall():
print(row)
connection.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question