phpmyadmin 已卸载,但仍提示通过浏览器登录

phpmyadmin 已卸载,但仍提示通过浏览器登录

今天发现 phpmyadmin 正在我的公共网络服务器上运行(!)。我立即卸载了它。我以为我已经卸载了它,直到我在浏览器中转到 [site]/phpmyadmin 并发现登录提示仍在出现。

我首先运行了 apt-get 实用程序:

sudo apt-get purge phpmyadmin*
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  phpmyadmin*
0 upgraded, 0 newly installed, 1 to remove and 266 not upgraded.
After this operation, 25.0 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 523610 files and directories currently installed.)
Removing phpmyadmin (4:4.6.6-5) ...
Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
(Reading database ... 521935 files and directories currently installed.)
Purging configuration files for phpmyadmin (4:4.6.6-5) ...
dpkg: warning: while removing phpmyadmin, directory '/usr/share/phpmyadmin' not empty so not removed

然后运行 ​​dpkg 进行确认..它说它已被卸载:

sudo dpkg-reconfigure phpmyadmin
dpkg-query: package 'phpmyadmin' 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: phpmyadmin is not installed

但浏览器仍然提示我登录:

phpmyadmin 登录提示

我做的一件事不是要做的是删除实际的 phpmyadmin 数据库。我知道我可能可以删除它而不会产生任何负面影响,但这些服务器托管的网站非常非常高可见性,我不想冒险。我认为留下一个孤立的数据库不会造成任何问题(除了浪费一点磁盘空间)。

除了已完成的操作之外,我是否需要采取一些手动步骤?

PS:我在这里发现了类似的问题,但已经一年多了,而且没有发布任何解决方案: 如何彻底卸载 phpMyAdmin?

答案1

您发布的 apt-get 输出中有以下行:

dpkg: warning: while removing phpmyadmin, directory '/usr/share/phpmyadmin' not empty so not removed

因此目录中仍会残留一些内容/usr/share/phpmyadmin,当您通过 Web 浏览器访问这些文件时,它们可能会提示您登录。请检查该目录的内容,如果其中没有对您重要的内容,则只需删除该目录即可。这应该可以解决问题。

相关内容