失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > 阿里云服务器下mysql卸载

阿里云服务器下mysql卸载

时间:2023-05-13 09:53:08

相关推荐

阿里云服务器下mysql卸载

一,登陆阿里云服务器后,查看mysql状态,看到LISTEN表示已安装mysql成功

1.

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo netstat -tap | grep mysqltcp 00 localhost:mysql *:* LISTEN3051/mysqld

二,卸载

2.

sudo apt-get remove mysql-server

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo apt-get remove mysql-serverReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following packages were automatically installed and are no longer required:libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perllibhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.7Use 'sudo apt autoremove' to remove them.The following packages will be REMOVED:mysql-server0 upgraded, 0 newly installed, 1 to remove and 61 not upgraded.After this operation, 110 kB disk space will be freed.Do you want to continue? [Y/n] Y(Reading database ... 102732 files and directories currently installed.)Removing mysql-server (5.7.24-0ubuntu0.16.04.1) ...

3,sudo apt-get autoremove mysql-server

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo apt-get autoremove mysql-serverReading package lists... DoneBuilding dependency tree Reading state information... DonePackage 'mysql-server' is not installed, so not removedThe following packages will be REMOVED:libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perllibhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-client-5.7 mysql-client-core-5.7 mysql-server-5.7 mysql-server-core-5.70 upgraded, 0 newly installed, 17 to remove and 61 not upgraded.After this operation, 162 MB disk space will be freed.Do you want to continue? [Y/n] y(Reading database ... 102728 files and directories currently installed.)Removing libcgi-fast-perl (1:2.10-1) ...Removing libhtml-template-perl (2.95-2) ...Removing libcgi-pm-perl (4.26-1) ...Removing libhttp-message-perl (6.11-1) ...Removing libencode-locale-perl (1.05-1) ...Removing mysql-server-5.7 (5.7.24-0ubuntu0.16.04.1) ...update-alternatives: using /etc/mysql/f.fallback to provide /etc/mysql/f (f) in auto modeRemoving libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...Removing libfcgi-perl (0.77-1build1) ...Removing libhtml-parser-perl (3.72-1) ...Removing libhtml-tagset-perl (3.20-2) ...Removing libhttp-date-perl (6.02-1) ...Removing libio-html-perl (1.001-1) ...Removing liblwp-mediatypes-perl (6.02-1) ...Removing liburi-perl (1.71-1) ...Removing mysql-client-5.7 (5.7.24-0ubuntu0.16.04.1) ...Removing mysql-client-core-5.7 (5.7.24-0ubuntu0.16.04.1) ...Removing mysql-server-core-5.7 (5.7.24-0ubuntu0.16.04.1) ...Processing triggers for man-db (2.7.5-1) ...Processing triggers for libc-bin (2.23-0ubuntu10) ...

4,sudo apt-get remove mysql-common

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo apt-get remove mysql-commonReading package lists... DoneBuilding dependency tree Reading state information... DoneThe following package was automatically installed and is no longer required:zlib1g-devUse 'sudo apt autoremove' to remove it.The following packages will be REMOVED:libmysqlclient-dev libmysqlclient20 mysql-common0 upgraded, 0 newly installed, 3 to remove and 61 not upgraded.After this operation, 11.5 MB disk space will be freed.Do you want to continue? [Y/n] y(Reading database ... 102286 files and directories currently installed.)Removing libmysqlclient-dev (5.7.24-0ubuntu0.16.04.1) ...Removing libmysqlclient20:amd64 (5.7.24-0ubuntu0.16.04.1) ...Removing mysql-common (5.7.24-0ubuntu0.16.04.1) ...Processing triggers for man-db (2.7.5-1) ...Processing triggers for libc-bin (2.23-0ubuntu10) ...

5,dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

root@iZ2ze47s90mcta2n9nz9mgZ:/# dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P(Reading database ... 102144 files and directories currently installed.)Removing linux-image-4.4.0-87-generic (4.4.0-87.110) ...Purging configuration files for linux-image-4.4.0-87-generic (4.4.0-87.110) ...Examining /etc/kernel/postrm.d .run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-87-generic /boot/vmlinuz-4.4.0-87-genericrun-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-87-generic /boot/vmlinuz-4.4.0-87-genericRemoving linux-image-extra-4.4.0-87-generic (4.4.0-87.110) ...Purging configuration files for linux-image-extra-4.4.0-87-generic (4.4.0-87.110) ...Removing mysql-common (5.7.24-0ubuntu0.16.04.1) ...Purging configuration files for mysql-common (5.7.24-0ubuntu0.16.04.1) ...Removing mysql-server-5.7 (5.7.24-0ubuntu0.16.04.1) ...Purging configuration files for mysql-server-5.7 (5.7.24-0ubuntu0.16.04.1) ...

6,sudo dpkg -i mysql-apt-config_0.7.2-1_all.deb

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo dpkg -i mysql-apt-config_0.7.2-1_all.debdpkg: error processing archive mysql-apt-config_0.7.2-1_all.deb (--install):cannot access archive: No such file or directoryErrors were encountered while processing:mysql-apt-config_0.7.2-1_all.deb

7,sudo apt-get update

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo apt-get updateHit:1 http://mirrors./ubuntu xenial InReleaseGet:2 http://mirrors./ubuntu xenial-updates InRelease [109 kB]Get:3 http://mirrors./ubuntu xenial-security InRelease [109 kB]Get:4 http://mirrors./ubuntu xenial-updates/main Sources [335 kB]Get:5 http://mirrors./ubuntu xenial-updates/universe Sources [254 kB]Get:6 http://mirrors./ubuntu xenial-updates/main amd64 Packages [957 kB]Get:7 http://mirrors./ubuntu xenial-updates/main i386 Packages [824 kB]Get:8 http://mirrors./ubuntu xenial-updates/main Translation-en [381 kB]Get:9 http://mirrors./ubuntu xenial-updates/universe amd64 Packages [748 kB]Get:10 http://mirrors./ubuntu xenial-updates/universe i386 Packages [685 kB]Get:11 http://mirrors./ubuntu xenial-updates/universe Translation-en [311 kB]Get:12 http://mirrors./ubuntu xenial-security/main Sources [146 kB]Get:13 http://mirrors./ubuntu xenial-security/universe Sources [105 kB]Get:14 http://mirrors./ubuntu xenial-security/main amd64 Packages [647 kB]Get:15 http://mirrors./ubuntu xenial-security/main i386 Packages [535 kB]Get:16 http://mirrors./ubuntu xenial-security/main Translation-en [264 kB]Get:17 http://mirrors./ubuntu xenial-security/universe amd64 Packages [435 kB]Get:18 http://mirrors./ubuntu xenial-security/universe i386 Packages [378 kB]Get:19 http://mirrors./ubuntu xenial-security/universe Translation-en [176 kB]Fetched 7,400 kB in 2s (3,579 kB/s)Reading package lists... Done

8,查看mysql是否卸载完sudo netstat -tap | grep mysql

root@iZ2ze47s90mcta2n9nz9mgZ:/# sudo netstat -tap | grep mysqlroot@iZ2ze47s90mcta2n9nz9mgZ:/#

我的这一步到此执行完后什么都不显示了,还有的显示如下

root@iZuf68o7f27da0srq88z1xZ:~# sudo netstat -tap | grep mysqlsudo: unable to resolve host iZuf68o7f27da0srq88z1xZ

如果觉得《阿里云服务器下mysql卸载》对你有帮助,请点赞、收藏,并留下你的观点哦!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。