在 Ubuntu 18.04 中完全删除 MariaDB 10.01

Mat*_*ios 1 sql mariadb

我在尝试完全清除Maria DB 并重新安装时遇到问题。

这就是我删除它的方法:

 2073  sudo apt-get remove --purge maria*
 2074  rm -f /var/log/mariadb
 2075  rm -f /var/log/mariadb/mariadb.log
 2076  rm -rf /var/lib/mysql
 2077  rm -rf /usr/lib64/mysql
 2078  rm -rf /usr/share/mysql
Run Code Online (Sandbox Code Playgroud)

然后我尝试重新安装为:

sudo apt install mariadb-server
mysql_secure_installation
Run Code Online (Sandbox Code Playgroud)

但问题是一旦我这样做了,我就会被提示输入 root 密码,不应该设置它,因为我应该已经清除了所有内容。

mysql_secure_installation 的输出:

[~]@Ubuntu1804  #> mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Enter current password for root (enter for none): 
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
Enter current password for root (enter for none): 
Aborting!
Run Code Online (Sandbox Code Playgroud)

如果我将它留空它会失败,但是如果我尝试使用正确的密码它也会失败。

如何从服务器中删除与 MariaDB 相关的所有内容

Aym*_*awy 11

只需运行此命令

sudo apt-get purge mariadb-* 
Run Code Online (Sandbox Code Playgroud)


Mat*_*ios 0

因此,就我而言,我最终转到/etc并删除了名为mysql的文件夹。它看起来很明显,但我认为删除时会自动完成?通过包管理器安装应用程序。