Answer the question
In order to leave comments, you need to log in
Why isn't MySQL recording?
I have code:
from mysql.connector import MySQLConnection, Error
class mysqlighter:
def __init__(self, db_conf):
self.conn = MySQLConnection(**db_conf)
self.cursor = self.conn.cursor()
def add_coin(self, coinsID, coins_symbol, coins_name):
"""Добавляем список коинов"""
with self.conn:
query = """INSERT INTO coinTables(id,symbol,name)
VALUES(%s,%s,%s)"""
args = (coinsID, coins_symbol, coins_name)
print(self)
print(self.cursor)
try:
self.cursor.execute(query, args)
except Error as error:
print(error)
def coin_Tables(self):
with self.conn:
self.cursor.execute("DROP TABLE coinTables")
create_table = """
CREATE TABLE coinTables (
id VARCHAR(255) NULL,
symbol VARCHAR(255) NULL,
name VARCHAR(255) NULL);
"""
self.cursor.execute(create_table)
2055: Lost connection to MySQL server at 'localhost:3306', system error: 9 Bad file descriptor
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