在Ubuntu 18.04中完全删除MariaDB 10.01



我在尝试完全清除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

然后我尝试重新安装为:

sudo apt install mariadb-server
mysql_secure_installation

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

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!

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

如何从服务器上删除所有与MariaDB相关的

只需运行此命令

sudo apt-get purge mariadb-* 

因此,在我的情况下,我最终转到/etc/strong>并删除了名为mysql的文件夹。这看起来很明显,但我认为当删除时会自动完成?通过软件包管理器下载应用程序。

最新更新