简体   繁体   中英

Uninstall MySQL in WSL

How do I uninstall MySQL in WSL?

I have version 5.7.4 installed. After reading over the changes for upgrading to the latest 5.7.x version so I could upgrade to 8.0 (there's a minimum requirement of 5.7.9 to upgrade to 8.0), I figured it would be easier to just uninstall MySQL and start over (I have nothing worth saving from playing around with it previously).

I tried running the following commands (as perthis post and this one ) and got the following responses:

$ sudo apt remove mysql mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mysql
$ sudo apt-get remove --purge *mysql*
zsh: no matches found: *mysql*
$ sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-* mysql-client-core-*
zsh: no matches found: mysql-server-core-*

After running those, I'm still able to start and stop my server with the following commands (note that these are not necessarily the usual systemd commands because I'm in WSL2):

  • sudo /etc/init.d/mysql start
  • mysqladmin -u root -p shutdown

Unsure if this is relevant, but even when the server is running I'm not seeing the socket when I enter sudo find / -type s as suggested by this post .

I'm wondering it'd be okay to just delete what files I can find manually, but that seems like a bad idea

  • /var/lib/mysql/
  • /usr/share/mysql/
  • /usr/lib/mysql/

The problem was using zsh as a shell. I successfully removed MySQL with sudo apt-get remove --purge '*mysql*'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM