卸载阿里云的mysql_阿里云(三) Ubuntu系统下mysql卸载

更多资料请点击:官方操作文档

一、ssh登录阿里云服务器,查看mysql的安装状态。

root@iZwz96t1p8ke0a4l01771vZ:~# sudo netstat -tap | grep mysql

tcp        0      0 localhost:mysql*:*                     LISTEN      24688/mysqld

以上表示,当前系统已经安装了mysql。

二、因为种种原因,我需要卸载mysql。

1、第一步: sudo apt-get remove mysql-server.

root@iZwz96t1p8ke0a4l01771vZ:~# sudo apt-get remove mysql-server

Reading package lists... Done

Building dependency tree

Reading state information... Done

The 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-perl

libhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-server-5.7 mysql-server-core-5.7

Use 'sudo apt autoremove' to remove them.

The following packages will be REMOVED:

mysql-server

0 upgraded, 0 newly installed, 1 to remove and 48 not upgraded.

After this operation, 175 kB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database ... 100504 files and directories currently installed.)

Removing mysql-server (5.7.17-0ubuntu0.16.04.2) ...

2、第二步:

sudo apt-get autoremove mysql-server.

root@iZwz96t1p8ke0a4l01771vZ:~# sudo apt-get autoremove mysql-server

Reading package lists... Done

Building dependency tree

Reading state information... Done

Package 'mysql-server' is not installed, so not removed

The 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-perl

libhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-server-5.7 mysql-server-core-5.7

0 upgraded, 0 newly installed, 15 to remove and 48 not upgraded.

After this operation, 96.3 MB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database ... 100500 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.17-0ubuntu0.16.04.2) ...

update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode

Removing 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-server-core-5.7 (5.7.17-0ubuntu0.16.04.2) ...

Processing triggers for man-db (2.7.5-1) ...

Processing triggers for libc-bin (2.23-0ubuntu5) ...

3、第三步:

sudo apt-get remove mysql-common.

root@iZwz96t1p8ke0a4l01771vZ:~# sudo apt-get remove mysql-common

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following package was automatically installed and is no longer required:

mysql-client-core-5.7

Use 'sudo apt autoremove' to remove it.

The following packages will be REMOVED:

mysql-client mysql-client-5.7 mysql-common

0 upgraded, 0 newly installed, 3 to remove and 48 not upgraded.

After this operation, 34.4 MB disk space will be freed.

Do you want to continue? [Y/n] y

(Reading database ... 100103 files and directories currently installed.)

Removing mysql-client (5.7.17-0ubuntu0.16.04.2) ...

Removing mysql-client-5.7 (5.7.17-0ubuntu0.16.04.2) ...

Removing mysql-common (5.7.17-0ubuntu0.16.04.2) ...

Processing triggers for man-db (2.7.5-1) ...

4、残留数据移除。

root@iZwz96t1p8ke0a4l01771vZ:~# dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

(Reading database ... 100056 files and directories currently installed.)

Removing mysql-common (5.7.17-0ubuntu0.16.04.2) ...

Purging configuration files for mysql-common (5.7.17-0ubuntu0.16.04.2) ...

Removing mysql-server-5.7 (5.7.17-0ubuntu0.16.04.2) ...

Purging configuration files for mysql-server-5.7 (5.7.17-0ubuntu0.16.04.2) ...

0818b9ca8b590ca3270a3433284dd417.png

5、最后一步。

root@iZwz96t1p8ke0a4l01771vZ:~# sudo dpkg -i mysql-apt-config_0.7.2-1_all.deb

dpkg: error processing archive mysql-apt-config_0.7.2-1_all.deb (--install):

cannot access archive: No such file or directory

Errors were encountered while processing:

mysql-apt-config_0.7.2-1_all.deb

root@iZwz96t1p8ke0a4l01771vZ:~# sudo dpkg -i mysql-apt-config_0.7.2-1_all.deb

dpkg: error processing archive mysql-apt-config_0.7.2-1_all.deb (--install):

cannot access archive: No such file or directory

Errors were encountered while processing:

mysql-apt-config_0.7.2-1_all.deb

root@iZwz96t1p8ke0a4l01771vZ:~# sudo apt-get update

Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial InRelease

Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-security InRelease

Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates InRelease

Hit:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-proposed InRelease

Hit:5 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-backports InRelease

Reading package lists... Done

三、卸载mysql完成。

root@iZwz96t1p8ke0a4l01771vZ:~# sudo netstat -tap | grep mysql

root@iZwz96t1p8ke0a4l01771vZ:~#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
mysql官网上下mysql-server_5.7.21-1ubuntu14.04_amd64.deb-bundle.tar,然后进行离线安装,解压该安装包,会出现11个依赖包,按照顺序依次使用sudo dpkg -i 进行安装,中间会报错,显示缺少相应的依赖,具体如下: *******@ubuntu:/opt/mysql$ sudo dpkg -i mysql-community-client_5.7.21-1ubuntu14.04_amd64.deb Selecting previously unselected package mysql-community-client. (Reading database ... 208518 files and directories currently installed.) Preparing to unpack mysql-community-client_5.7.21-1ubuntu14.04_amd64.deb ... Unpacking mysql-community-client (5.7.21-1ubuntu14.04) ... dpkg: dependency problems prevent configuration of mysql-community-client: mysql-community-client depends on libaio1 (>= 0.3.93); however: Package libaio1 is not installed. dpkg: error processing package mysql-community-client (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Errors were encountered while processing: mysql-community-client 和 ********@ubuntu:/opt/mysql$ sudo dpkg -i mysql-community-server_5.7.21-1ubuntu14.04_amd64.deb Selecting previously unselected package mysql-community-server. (Reading database ... 208598 files and directories currently installed.) Preparing to unpack mysql-community-server_5.7.21-1ubuntu14.04_amd64.deb ... Unpacking mysql-community-server (5.7.21-1ubuntu14.04) ... dpkg: dependency problems prevent configuration of mysql-community-server: mysql-community-server depends on libmecab2 (>= 0.996-1.1); however: Package libmecab2 is not installed. dpkg: error processing package mysql-community-server (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for ureadahead (0.100.0-16) ... ureadahead will be reprofiled on next reboot Errors were encountered while processing: mysql-community-server 附上依赖包安装顺序: 1.mysql-common_5.7.21-1ubuntu14.04_amd64.deb 2.libmysqlclient20_5.7.21-1ubuntu14.04_amd64.deb 3.libmysqlclient-dev_5.7.21-1ubuntu14.04_amd64.deb 4.libmysqld-dev_5.7.21-1ubuntu14.04_amd64.deb
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值