I’m using library discord.py and i have issue with mysql.connector. I use mariadb database for server prefixes but when my bot runs 24/7, it starts throwing these errors 0|PyBot | File "/home/pi/.local/lib/python3.7/site-packages/discord/utils.py", line 329, in maybe_coroutine 0|PyBot | value = f(*args, **kwargs) 0|PyBot | File "/home/pi/PyBotV2/bot/main.py", line 11, in get_prefix 0|PyBot | return fetch_prefix(message.guild.id) 0|PyBot […]
- Tags _strioerror(err))) 0|PyBot | mysql.connector.errors.OperationalError: 2055: Lost connection to MySQL server at 'localhost:3306', )), )) 0|PyBot | File "/home/pi/.local/lib/python3.7/site-packages/mysql/connector/cursor.py", )) mydb.commit() def remove_prefix(gid): prefix_query = "DELETE FROM servers WHERE id = %s" cursor.execute(prefix_query, )) mydb.commit() def update_prefix(gid, )) prefix = cursor.fetchone() return prefix[0] def add_prefix(gid, **kwargs) 0|PyBot | File "/home/pi/PyBotV2/bot/main.py", %s)" cursor.execute(prefix_query, compressed_packet_number) 0|PyBot | File "/home/pi/.local/lib/python3.7/site-packages/mysql/connector/network.py", database="discord_bot" ) cursor = mydb.cursor() def fetch_prefix(gid): prefix_query = "SELECT prefix FROM servers WHERE id = %s" cu, gid, I'm using library discord.py and i have issue with mysql.connector. I use mariadb database for server prefixes but when my bot runs 24/7, in _send_cmd 0|PyBot | packet_number, in cmd_query 0|PyBot | result = self._handle_result(self._send_cmd(ServerCmd.QUERY, in execute 0|PyBot | self._handle_result(self._connection.cmd_query(stmt)) 0|PyBot | File "/home/pi/.local/lib/python3.7/site-pac, in fetch_prefix 0|PyBot | cursor.execute(prefix_query, in get_prefix 0|PyBot | return fetch_prefix(message.guild.id) 0|PyBot | File "/home/pi/PyBotV2/bot/cogs/database.py", in maybe_coroutine 0|PyBot | value = f(*args, in send_plain 0|PyBot | errno=2055, it starts throwing these errors 0|PyBot | File "/home/pi/.local/lib/python3.7/site-packages/discord/utils.py", line 11, line 143, line 15, line 261, line 490, line 551, line: 329, password='password', prefix, prefix = "."): prefix_query = "INSERT INTO servers(id, prefix) VALUES (%s, prefix): prefix_query = "UPDATE servers SET prefix = %s WHERE id = %s" cursor.execute(prefix_query, query)) 0|PyBot | File "/home/pi/.local/lib/python3.7/site-packages/mysql/connector/connection.py", system error: 32 Broken pipe My code for DB connection: import mysql.connector mydb = mysql.connector.connect( host="localhost", userUsername: "", values=(self.get_address()