拒绝用户“debian-sys-maint”@“localhost”访问

拒绝用户“debian-sys-maint”@“localhost”访问

我刚刚在系统日志中注意到了这条消息,但一直找不到解决方案。我找到的大多数解决方案都是关于恢复 root 密码(我知道并且可以成功使用),而不是获取“debian-sys-maint”用户的正确密码。我找到的一个解决方案提出了一个更奇怪的问题:为什么我的系统对安装的 MySQL 版本感到困惑?

当我以 root 身份登录时,我看到以下内容:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.23 MySQL Community Server (GPL)

(还有更多)。因此我尝试重新配置服务器(正如我找到的文章所建议的那样),然后看到了以下内容:

user@cpu:~$ sudo dpkg-reconfigure mysql-server-5.7
dpkg-query: package 'mysql-server-5.7' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
/usr/sbin/dpkg-reconfigure: mysql-server-5.7 is not installed

mysql 报告其服务器版本为 5.7 但 dpkg 认为 mysql-server-5.7 未安装,这让我感到困惑,我想我会尝试早期版本,结果发现了这一点:

user@cpu:~$ sudo dpkg-reconfigure mysql-server-5.6
/usr/sbin/dpkg-reconfigure: mysql-server-5.6 is broken or not fully installed

所以现在我有两个问题:

  1. 纠正此帖子主题中显示的错误的正确程序是什么?(我可能能够使用 root mysql 用户和文本编辑器手动使其工作,但感觉不对。)
  2. 就安装和运行而言,如何使 dpkg 与 mysql 同步?(FWIW,mysql 是在一个(或多个)Ubuntu 发行版从一个 LTS 版本升级到另一个 LTS 版本期间升级的。我现在使用的是 18.x,但几年前从 12.x 开始的。)

我很抱歉我不是专家。我们是一家小公司,有一个小型网络服务器,是我接手的,而我的主要工作是为 Windows 编写代码。

编辑:添加建议命令的输出。

user@cpu:~$ sudo dpkg -l mysql*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  mysql          <none>       <none>       (no description available)
dpkg-query: no packages found matching mysql56.tar.bz2
dpkg-query: no packages found matching mysql.tar.bz2

在我看来,dpkg 认为 mysql 未安装,而 mysql 认为 v5.7 正在运行。

相关内容