Почему pymysql не распознаёт базу данных?
Я заполняю данные, создал бд с помощью MySQL Workbench
Заполнил всё правильно
Но pymysql выдаёт такую ошибку:
Task exception was never retrieved
future: <Task finished name='Task-9' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py:407> exception=OperationalError(1049, "Unknown database 'testik123'")>
Traceback (most recent call last):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 235, in process_updates
return await asyncio.gather(*tasks)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\handler.py", line 116, in notify
response = await handler_obj.handler(*args, **partial_data)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 256, in process_update
return await self.message_handlers.notify(update.message)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\aiogram\dispatcher\handler.py", line 116, in notify
response = await handler_obj.handler(*args, **partial_data)
File "C:\Users\Admin\Desktop\Audio_Bot_Telegram 2\AudioBot.py", line 50, in start_message_command
await main_menu(message.chat.id)
File "C:\Users\Admin\Desktop\Audio_Bot_Telegram 2\AudioBot.py", line 24, in main_menu
if bool(dbWorker.chek_user(chat_id)):
File "C:\Users\Admin\Desktop\Audio_Bot_Telegram 2\dbWorker.py", line 11, in fnrepl
connection = pymysql.connect(host=db_config['host'],
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\connections.py", line 353, in __init__
self.connect()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\connections.py", line 633, in connect
self._request_authentication()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\connections.py", line 932, in _request_authentication
auth_packet = _auth.caching_sha2_password_auth(self, auth_packet)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\_auth.py", line 239, in caching_sha2_password_auth
pkt = conn._read_packet()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
packet.raise_for_error()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1049, "Unknown database 'testik123'")