宝塔用户_snubbk 发表于 2025-8-7 08:55:23

【已解决】数据库更改权限、备份时报错

为了能快速了解并处理您的问题,请提供以下基础信息:面板、插件版本:
Linux面板11.0.0
系统版本:
系统:Alibaba Cloud 3 (OpenAnolis Edition) x86_64(Py3.7.16)问题描述:
数据库更改权限、备份时报错
相关截图(日志、错误):
Traceback (most recent call last):File "/www/server/panel/BTPanel/__init__.py", line 2539, in publicObject    res = run_obj.run(toObject, defs, get)File "/www/server/panel/BTPanel/__init__.py", line 2486, in run    result = getattr(toObject, get.action)(get)File "class/database.py", line 2249, in GetDatabaseAccess    isError = self.IsSqlError(users)File "class/database.py", line 833, in IsSqlError    import pymysqlModuleNotFoundError: No module named 'pymysql'

阿珂 发表于 2025-8-7 10:32:26

btpip install pymysql
bt 16
bt 1
执行命令,重试一下

宝塔用户_snubbk 发表于 2025-8-7 15:01:37

执行报错
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

宝塔用户_snubbk 发表于 2025-8-7 15:12:44

执行时报错
(pyenv) # btpip install pymysql
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Requirement already satisfied: pymysql in /www/server/panel/pyenv/lib/python3.7/site-packages (1.0.3)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(pyenv) #

阿珂 发表于 2025-8-7 17:09:10

btpip install PyMySQL==0.9.3
bt 1

宝塔用户_snubbk 发表于 2025-8-7 18:06:10

可以了,感谢
页: [1]
查看完整版本: 【已解决】数据库更改权限、备份时报错