当前位置:论坛首页 > Linux面板 > 求助

宝塔不适配MariaDB

发表在 Linux面板2026-7-9 10:40 [复制链接] 0 129

本帖最后由 MrHope 于 2026-7-9 10:49 编辑

为了能快速了解并处理您的问题,请提供以下基础信息:
面板、插件版本:

11.8.1
系统版本:

debian 13
问题描述:

我是刚刚在干净的debian13安装了宝塔(11.8.0)。然后原地升级到 11.8.1,安装了MariaDB 11.8.6宝塔的改密功能完全不工作。
我通过命令行导入了一个数据库,宝塔不能同步密码也不能改密。这给我保存/获取密码带来了极大的不便。
相关截图(日志、错误):

在网页上修改密码会提示:

View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

抓取的日志如下:


/www/server/mysql/bin/mariadbd, Version: 11.8.6-MariaDB-log (Source distribution). started with:


Tcp port: 3306  Unix socket: /tmp/mysql.sock
Time                    Id Command        Argument
260709 10:31:56           561 Connect        innenu@localhost on innenu-service using TCP/IP
561 Connect        Access denied for user 'innenu'@'localhost' (using password: NO)
562 Connect        innenu@localhost on innenu-service using TCP/IP
562 Connect        Access denied for user 'innenu'@'localhost' (using password: NO)
260709 10:31:57           563 Connect        innenu@localhost on innenu-service using TCP/IP
563 Connect        Access denied for user 'innenu'@'localhost' (using password: NO)
260709 10:31:59           564 Connect        root@localhost on  using Socket
564 Query        SET AUTOCOMMIT = 0
564 Query        select * from mysql.user where User='innenu-service'
564 Quit
565 Connect        root@localhost on  using Socket
565 Query        SET AUTOCOMMIT = 0
565 Query        update mysql.user set Password=password('*********(已替换)') where User='innenu-service'
566 Connect        root@localhost on  using Socket
566 Query        SET AUTOCOMMIT = 0
566 Query        show variables like 'datadir'
566 Quit
567 Connect        root@localhost on  using Socket
567 Query        SET AUTOCOMMIT = 0
567 Query        show variables like 'datadir'
567 Quit



从日志可以清晰的看出,即使安装了MariaDB,宝塔仍在用5.7的方式去修改密码。而 MariaDB 11.x 不支持password(),并且 10.4 之后 mysql.user 表就是只读的了。


做了一些 debug。

grep: /www/server/panel/class/__pycache__/database.cpython-37.pyc: binary file matches
/www/server/panel/class/database.py:1293:                    result = mysql_obj.execute("update mysql.user set Password=password('" + password + "') where User='{}'".format(admin_user))
/www/server/panel/class/database.py:1356:            result = mysql_obj.execute("update mysql.user set Password=password('" + newpassword + "') where User='" + username + "'")
/www/server/panel/class/database.py:3636:            result = mysql_obj.execute("update mysql.user set Password=password('{}') where User='{}'".format(newpassword, username))
root@localhost:/home/www#


/www/server/panel/class/database.py 有问题,这里面有三处都写死了以下内容:

elif any(mariadb_ver in m_version for mariadb_ver in ['10.5.', '10.4.', '10.6.', '10.7.', '10.11.', '11.3.']):

这里面没有他娘的 11.8,修一下谢谢。我本地先自己patch一下。


使用道具 举报 只看该作者 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

紧急运维服务

响应时间:3分钟

问题处理方式:宝塔专家1对1服务

工作时间:工作日:9:00 - 18:30

宝塔专业团队为您解决服务器疑难问题

点击联系技术分析

工作时间:09:00至18:30

快速回复 返回顶部 返回列表