使用mysql作为数据库时有问题
➜ YPrompt-main cat ./data/logs/backend/yprompt.log
2025-12-09 15:14:39,786 | INFO | Sanic v23.12.1 2025-12-09 15:14:39,787 | INFO | Goin' Fast @ http://0.0.0.0:8888 2025-12-09 15:14:39,787 | INFO | app: apps 2025-12-09 15:14:39,787 | INFO | mode: production, single worker 2025-12-09 15:14:39,787 | INFO | server: sanic, HTTP/1.1 2025-12-09 15:14:39,787 | INFO | python: 3.12.12 2025-12-09 15:14:39,787 | INFO | platform: Linux-6.10.14-linuxkit-aarch64-with 2025-12-09 15:14:39,787 | INFO | auto-reload: enabled, /app/backend/templates 2025-12-09 15:14:39,787 | INFO | packages: sanic-routing==23.12.0, sanic-ext==23.12.0 2025-12-09 15:14:40,573 | INFO | Sanic Extensions: 2025-12-09 15:14:40,573 | INFO | > injection [0 dependencies; 0 constants] 2025-12-09 15:14:40,573 | INFO | > openapi [http://0.0.0.0:8888/docs] 2025-12-09 15:14:40,573 | INFO | > http 2025-12-09 15:14:40,573 | INFO | > templating [jinja2==3.1.2] /usr/lib/python3.12/site-packages/sanic/touchup/schemes/ode.py:70: DeprecationWarning: Attribute s is deprecated and will be removed in Python 3.14; use value instead if hasattr(event, "s"): 2025-12-09 15:14:40,590 | INFO | 📦 初始化数据库: mysql 2025-12-09 15:14:40,591 | INFO | 🔗 MySQL数据库: 10.xx.144.xx/bigdata_report 2025-12-09 15:14:40,599 | INFO | ✅ MySQL连接池创建成功: 10.xx.144.xx/bigdata_report 2025-12-09 15:14:40,599 | INFO | ✅ 数据库初始化成功: mysql 2025-12-09 15:18:48,066 | ERROR | ❌ 验证本地用户失败: not all arguments converted during string formatting 2025-12-09 15:19:12,926 | ERROR | ❌ 验证本地用户失败: not all arguments converted during string formatting 2025-12-09 15:19:46,869 | ERROR | ❌ 创建本地用户失败: not all arguments converted during string formatting 2025-12-09 15:19:46,873 | ERROR | ❌ 本地注册接口异常: not all arguments converted during string formatting Traceback (most recent call last): File "/app/backend/apps/modules/auth/views.py", line 266, in local_register user = await auth_service.create_local_user(username, password, name or username) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/apps/modules/auth/services.py", line 131, in create_local_user existing_user = await self.db.get(sql, [username]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/backend/apps/utils/db_adapter.py", line 90, in get return await self.db.get(sql, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/ezmysql/connection_async.py", line 98, in get await cur.execute(query, kwparameters or parameters) File "/usr/lib/python3.12/site-packages/aiomysql/cursors.py", line 237, in execute query = query % self._escape_args(args, conn) ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TypeError: not all arguments converted during string formatting 2025-12-09 15:20:07,952 | ERROR | ❌ 验证本地用户失败: not all arguments converted during string formatting
使用的docker compose up,更改了你的代码中yml中的数据库配置为mysql
然后点击登陆或者注册时就会出现问题
最近一直在打磨功能和用户体验,都是用sqlite开发测试的,mysql我找时间测试修复下
好的,期待你的测试,加油