我在尝试完全清除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 密码,不应该设置它,因为我应该已经清除了所有内容。
[~]@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 相关的所有内容?