所以我有一个非常有趣的问题.我试图重置我的MySQL密码,然后我被锁定在MySQL之外.没什么大不了的,我可以卸载MySQL吧?
错误.
我跑了:
sudo apt-get --purge remove mysql-client mysql-server mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /etc/mysql/
Run Code Online (Sandbox Code Playgroud)
但是在安装大约10分钟后我遇到了这个问题:
? Unable to set password for the MySQL "root" user ?
? ?
? An error occurred while setting the password for the MySQL administrative user. This may have happened ?
? because the account already has a password, or because of a communication problem with the MySQL server. ?
? ?
? You should check the account's password after the package installation. ?
? ?
? Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more information.
Run Code Online (Sandbox Code Playgroud)
如何正确删除MySQL以便我可以重新安装它?
您需要删除/ var/lib/mysql文件夹.
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo rm -rf /var/lib/mysql
Run Code Online (Sandbox Code Playgroud)
我之前有类似的问题.最后一行帮助了我.我希望它对你也有帮助.