当前位置: 首页 > 知识库问答 >
问题:

如何删除MySQL完全与配置和库文件?

郎飞航
2023-03-14

到目前为止,我已经尝试了以下命令:

sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get autoremove

但每当我尝试使用以下命令查找MySQL时,我都会得到一个与MySQL相关的文件列表:

shell>> locate mysql

输出:

/etc/mysql
/etc/apparmor.d/usr.sbin.mysqld
/etc/apparmor.d/abstractions/mysql
/etc/apparmor.d/cache/usr.sbin.mysqld
/etc/apparmor.d/cache/usr.sbin.mysqld-akonadi
/etc/apparmor.d/local/usr.sbin.mysqld
/etc/bash_completion.d/mysqladmin
/etc/init/mysql.conf
/etc/logcheck/ignore.d.paranoid/mysql-server-5_5
/etc/logcheck/ignore.d.server/mysql-server-5_5
/etc/logcheck/ignore.d.workstation/mysql-server-5_5
/etc/logrotate.d/mysql-server
/etc/mysql/conf.d
/etc/mysql/debian-start
/etc/mysql/debian.cnf
/etc/mysql/conf.d/mysqld_safe_syslog.cnf
/home/pkr/.mysql_history
/home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,libqt4-sql-mysql,,349051c3a57da571aa832adb39177aff
/home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,mysql-client,,cbf77a486cdc80547317981a33144427
/home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,mysql-client,,de8220dee4d957a9502caa79e8d2fdda
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,libqt4-sql-mysql,page,1,helpful,,17fb2e657321dc51526ee8fe9928da30
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,mysql-client,page,1,helpful,,a4c1b6e8200f36ab5745c6f81f14da0a
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,oneiric,any,libqt4-sql-mysql,page,1,helpful,,c54295fb82b8183350cd34f22c3547ef
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,oneiric,any,mysql-client,page,1,helpful,,fcf201c1abff3f774af89173a84de2cc
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,precise,any,libqt4-sql-mysql,page,1,helpful,,0cd86648584efeccfb16119012f89540
/home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,precise,any,mysql-client,page,1,helpful,,eb84724e9da7851ff8862a227d8bac59
/home/pkr/.local/share/akonadi/mysql.conf
/home/pkr/.local/share/akonadi/db_data/mysql
/home/pkr/.local/share/akonadi/db_data/mysql.err
/home/pkr/.local/share/akonadi/db_data/mysql.err.old
/home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/db.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/db.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/db.frm
/home/pkr/.local/share/akonadi/db_data/mysql/event.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/event.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/event.frm
/home/pkr/.local/share/akonadi/db_data/mysql/func.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/func.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/func.frm
/home/pkr/.local/share/akonadi/db_data/mysql/general_log.CSM
/home/pkr/.local/share/akonadi/db_data/mysql/general_log.CSV
/home/pkr/.local/share/akonadi/db_data/mysql/general_log.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_category.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_category.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_category.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_relation.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_relation.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_relation.frm
/home/pkr/.local/share/akonadi/db_data/mysql/help_topic.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/help_topic.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/help_topic.frm
/home/pkr/.local/share/akonadi/db_data/mysql/host.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/host.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/host.frm
/home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.frm
/home/pkr/.local/share/akonadi/db_data/mysql/plugin.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/plugin.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/plugin.frm
/home/pkr/.local/share/akonadi/db_data/mysql/proc.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/proc.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/proc.frm
/home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/servers.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/servers.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/servers.frm
/home/pkr/.local/share/akonadi/db_data/mysql/slow_log.CSM
/home/pkr/.local/share/akonadi/db_data/mysql/slow_log.CSV
/home/pkr/.local/share/akonadi/db_data/mysql/slow_log.frm
/home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.frm
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.frm
/home/pkr/.local/share/akonadi/db_data/mysql/user.MYD
/home/pkr/.local/share/akonadi/db_data/mysql/user.MYI
/home/pkr/.local/share/akonadi/db_data/mysql/user.frm
/usr/bin/mysql
/usr/bin/mysql_install_db
/usr/bin/mysql_upgrade
/usr/bin/mysqlcheck
/usr/sbin/mysqld
/usr/share/mysql
/usr/share/app-install/desktop/gmysqlcc:gmysqlcc.desktop
/usr/share/app-install/desktop/mysql-client.desktop
/usr/share/app-install/desktop/mysql-navigator:mysql-navigator.desktop
/usr/share/app-install/desktop/mysql-server.desktop
/usr/share/app-install/icons/gmysqlcc-32.png
/usr/share/app-install/icons/mysql-navigator.png
/usr/share/doc/mysql-client-core-5.5
/usr/share/doc/mysql-server-core-5.5
/usr/share/kde4/apps/katepart/syntax/sql-mysql.xml
/usr/share/man/man1/mysql.1.gz
/usr/share/man/man1/mysql_install_db.1.gz
/usr/share/man/man1/mysql_upgrade.1.gz
/usr/share/man/man1/mysqlcheck.1.gz
/usr/share/man/man8/mysqld.8.gz
/var/cache/apt/archives/akonadi-backend-mysql_1.7.2-0ubuntu1_all.deb
/var/cache/apt/archives/libmysqlclient-dev_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/libmysqlclient18_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/libqt4-sql-mysql_4%3a4.8.1-0ubuntu4.1_i386.deb
/var/cache/apt/archives/mysql-client-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-client-core-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-client_5.5.22-0ubuntu1_all.deb
/var/cache/apt/archives/mysql-common_5.5.22-0ubuntu1_all.deb
/var/cache/apt/archives/mysql-server-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-server-core-5.5_5.5.22-0ubuntu1_i386.deb
/var/cache/apt/archives/mysql-server_5.5.22-0ubuntu1_all.deb
/var/lib/dpkg/info/mysql-client-core-5.5.list
/var/lib/dpkg/info/mysql-client-core-5.5.md5sums
/var/lib/dpkg/info/mysql-server-5.5.list
/var/lib/dpkg/info/mysql-server-5.5.postrm
/var/lib/dpkg/info/mysql-server-core-5.5.list
/var/lib/dpkg/info/mysql-server-core-5.5.md5sums
/var/log/mysql
/var/log/mysql.err
/var/log/mysql.log
/var/log/mysql.log.1.gz
/var/log/mysql.log.2.gz
/var/log/mysql.log.3.gz
/var/log/mysql.log.4.gz
/var/log/mysql.log.5.gz
/var/log/mysql.log.6.gz
/var/log/mysql.log.7.gz
/var/log/upstart/mysql.log.1.gz
/var/log/upstart/mysql.log.2.gz
/var/log/upstart/mysql.log.3.gz
/var/log/upstart/mysql.log.4.gz
/var/log/upstart/mysql.log.5.gz
/var/log/upstart/mysql.log.6.gz
/var/log/upstart/mysql.log.7.gz

我现在该怎么办?

我试图找出是否有任何方法可以删除所有与MySQL相关的文件,然后重新安装MySQL。

我需要它来连接Qt。

共有3个答案

鲜于致远
2023-03-14

即使在执行mysql删除命令和命令删除Mariadb当我运行


    sudo dpkg -l | grep -i mysql

我仍然得到下面的把它显示文件从mysql服务器目前

pi@Home:/ $ sudo dpkg -l | grep -i mysql
ii  mysql-common                          5.8+1.0.5                              all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  php-mysql                             2:7.3+69                               all          MySQL module for PHP [default]
ii  php7.3-mysql                          7.3.27-1~deb10u1                       armhf        MySQL module for PHP
ii  phpmyadmin                            4:4.6.6-5                              all          MySQL web administration tool

但是当我运行以下命令时,我没有看到mysql的迹象


> pi@Home:/ $ sudo mysql sudo: mysql: command not found pi@Home:/ $ sudo
> service mysql restart Failed to restart mysql.service: Unit
> mysql.service not found.

这是什么意思?如果mysql被删除,那么为什么我还在查看这些文件,如果我重新安装mysql,它不会干扰新的安装

劳仲渊
2023-03-14

对@dAm2k的答案稍加补充:

除了sudo apt-get删除--purge mysql\*

我已经做了一个sudo apt get remove--purge mariadb\*

在debian(stretch)的新版本中,当您安装mysql时,它会安装mariadb包。

希望能有帮助。

闻人梓
2023-03-14

使用命令:

sudo apt-get remove --purge mysql\*

您可以删除任何与名为mysql的包相关的内容。这些命令只在基于debian/debian的linux发行版上有效(例如Ubuntu)。

您可以使用以下命令列出所有已安装的mysql软件包:

sudo dpkg -l | grep -i mysql

要进一步清理包缓存,可以使用以下命令:

sudo apt-get clean

另外,记住使用命令:

sudo updatedb

否则,“定位”命令将显示旧数据。

要再次安装mysql,请使用以下命令:

sudo apt-get install libmysqlclient-dev mysql-client

这将安装mysql客户端、libmysql及其头文件。

要安装mysql服务器,请使用以下命令:

sudo apt-get install mysql-server
 类似资料:
  • < b >想改进这个问题?更新问题,使其成为关于堆栈溢出的主题。 我正在尝试从我的ubuntu 12.04中完全卸载mysql。但无法。 我尝试了很多命令。但没有任何效果。任何人都可以在这里帮忙! 我不明白该怎么做。我想删除有关MySQL的所有内容。每当我试图定位它时。我明白了。 我希望一切都被删除。mysql服务器、mysql客户端、mysqls库甚至配置。 请帮帮我!!!

  • 问题内容: 现在我收到错误消息如何成功清除数据库或迁移? 问题答案: 要从磁盘上完全删除Realm文件并从头开始,只需使用手动删除它即可。 例如,要删除默认的Realm文件: 如果要保留Realm文件,但将对象完全清空,则可以调用以下方法: 更新: 我觉得我在原始答案中没有提到这一点。如果选择从磁盘删除Realm文件,则必须在应用程序中的任何线程上打开它之前,都必须这样做。打开后,Realm会在内

  • 问题内容: 我从不同的文件夹中删除了詹金斯所有目录。但是,当我访问URL时,仍然显示jenkins登录。 我想完全卸载jenkins。已经尝试了许多来自Internet的命令,但是服务器上仍然有jenkins。 我只有通过腻子进行命令行访问,因此我尝试通过命令删除jenkins。 问题答案: 如果您的詹金斯人以服务而不是进程的形式运行,则应先使用 停止后,您可以按照与Linux风格相对应的命令按照

  • 问题内容: 我卸载了先前版本的node.js(0.8.11),并从node.js网站下载了最新版本0.10.24并进行了安装。但是,运行后,仍然表明我正在运行v0.8.11。显然,在卸载过程中遗留了一些东西,这导致我在尝试通过npm添加模块时遇到各种错误。我已经看到了针对OSX和Linux的解决方案,但找不到Windows的任何东西。我正在运行Windows 7 64位。 问题答案: 如何从Win

  • 问题内容: 如何从Mac上完全删除Cordova和离子安装?我正在运行Mac OS Yosemite 10.10.2 问题答案: BlueBell的答案是正确的,您可以通过以下方法实现: 您打算重新安装它吗?如果您觉得有问题的原因而引起问题,则应更新npm并清理 npm 的缓存。 如果问题仍然存在,建议您重新安装NPM和Node。 如果您在此过程中遇到问题,请告诉我。

  • 问题内容: 我回来时在Ubuntu上安装了Docker,但是当我尝试删除Docker时,系统中仍然存在。我遵循了这个https://stackoverflow.com/a/31313851/2340159,但是没有用。 问题答案: 显然,我正在使用的系统具有 docker-ce 而不是Docker。因此,在命令下运行即可达到目的。