1. rpm -qa|grep aria

MariaDB-client-10.1.22-1.x86_64
MariaDB-devel-10.1.22-1.x86_64
MariaDB-shared-10.1.22-1.x86_64
MariaDB-cracklib-password-check-10.1.22-1.x86_64
MariaDB-common-10.1.22-1.x86_64
MariaDB-server-10.1.22-1.x86_64

2. rpm -e  `rpm -qa|grep aria`

redirecting to systemctl stop mysql.service
Usage:
insserv [[-r] <script>]

Options:
--remove, -r
Remove the listed scripts from all runlevels

/sbin/insserv failed, exit code 1

Note: This output shows SysV services only and does not include native
systemd services. SysV configuration data might be overridden by native
systemd configuration.

If you want to list systemd services use 'systemctl list-unit-files'.
To see services enabled on particular target use
'systemctl list-dependencies [target]'.

mysql 0:off 1:off 2:off 3:off 4:off 5:off 6:off
error: %preun(MariaDB-server-10.1.22-1.x86_64) scriptlet failed, exit status 1
error: MariaDB-server-10.1.22-1.x86_64: erase failed

3.查看依赖:

rpm -q -scripts MariaDB-server-10.1.22-1.x86_64

preinstall scriptlet (using /bin/sh):
# Check if we can safely upgrade. An upgrade is only safe if it's from one
# of our RPMs in the same version family.

installed=`rpm -q --whatprovides mysql-server 2> /dev/null`
if [ $? -eq 0 -a -n "$installed" ]; then
installed=`echo "$installed"|sed -n 1p`
vendor=`rpm -q --queryformat='%{VENDOR}' "$installed" 2>&1`
version=`rpm -q --queryformat='%{VERSION}' "$installed" 2>&1`
myvendor='Monty Program AB'
myversion='10.1.22'

old_family=`echo $version | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`
new_family=`echo $myversion | sed -n -e 's,^\([1-9][0-9]*\.[0-9][0-9]*\)\..*$,\1,p'`

[ -z "$vendor" ] && vendor='<unknown>'
[ -z "$old_family" ] && old_family="<unrecognized version $version>"
[ -z "$new_family" ] && new_family="<bad package specification: version $myversion>"

error_text=
if [ "$vendor" != "$myvendor" ]; then
error_text="$error_text
The current MariaDB server package is provided by a different
vendor ($vendor) than $myvendor. Some files may be installed
to different locations, including log files and the service
startup script in /etc/init.d/.
"
fi

if [ "$old_family" != "$new_family" ]; then
error_text="$error_text
Upgrading directly from MySQL $old_family to MariaDB $new_family may not
be safe in all cases. A manual dump and restore using mysqldump is
recommended. It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.
"
fi

if [ -n "$error_text" ]; then
cat <<HERE >&2

******************************************************************
A MySQL or MariaDB server package ($installed) is installed.
$error_text
A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages. Usually this command will
list the packages you should remove:
rpm -qa | grep -i '^mysql-'

You may choose to use 'rpm --nodeps -ev <package-name>' to remove
the package which contains the mysqlclient shared library. The
library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by $myvendor
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process. Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
HERE
exit 1
fi
fi
postinstall scriptlet (using /bin/sh):
if [ -f /usr/lib/systemd/system/mariadb.service -a -x /usr/bin/systemctl ]; then
systemd_conf=/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf
if [ -x /usr/bin/mariadb-service-convert -a ! -f "${systemd_conf}" ]; then
# Either fresh install or upgrade non-systemd -> systemd
mkdir -p /etc/systemd/system/mariadb.service.d
/usr/bin/mariadb-service-convert > "${systemd_conf}"
# Make sure old possibly non-systemd instance is down
if [ $1 = 2 ]; then
SYSTEMCTL_SKIP_REDIRECT=1 /etc/init.d/mysql stop >/dev/null 2>&1 || :
systemctl start mariadb >/dev/null 2>&1 || :
fi
systemctl enable mariadb.service >/dev/null 2>&1 || :
fi
fi

# Make MySQL start/shutdown automatically when the machine does it.
if [ $1 = 1 ] ; then
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload >/dev/null 2>&1
fi

if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --add mysql
fi

basedir=`/usr/bin/my_print_defaults --mysqld|sed -ne 's/^--basedir=//p'|tail -1`
if [ -z "$basedir" ] ; then
basedir=/usr
fi

datadir=`/usr/bin/my_print_defaults --mysqld|sed -ne 's/^--datadir=//p'|tail -1`
if [ -z "$datadir" ] ; then
datadir=/var/lib/mysql
else
# datadir may be relative to a basedir!
if ! expr $datadir : / > /dev/null; then
datadir=$basedir/$datadir
fi
fi

# Create a MySQL user and group. Do not report any problems if it already
# exists.
groupadd -r mysql 2> /dev/null || true
useradd -M -r --home $datadir --shell /sbin/nologin --comment "MySQL server" --gid mysql mysql 2> /dev/null || true
# The user may already exist, make sure it has the proper group nevertheless (BUG#12823)
usermod --gid mysql mysql 2> /dev/null || true

# Temporary Workaround for MDEV-11386 - will be corrected in Advance Toolchain 10.0-3 and 8.0-8
for ldconfig in /opt/at*/sbin/ldconfig; do
test -x $ldconfig && $ldconfig
done

# Change permissions so that the user that will run the MySQL daemon
# owns all database files.
chown -R mysql:mysql $datadir

if [ ! -e $datadir/mysql ]; then
# Create data directory
mkdir -p $datadir/{mysql,test}

# Initiate databases
/usr/bin/mysql_install_db --rpm --user=mysql
fi

# Change permissions again to fix any new files.
chown -R mysql:mysql $datadir

# Fix permissions for the permission database so that only the user
# can read them.
chmod -R og-rw $datadir/mysql
fi

# install SELinux files - but don't override existing ones
SETARGETDIR=/etc/selinux/targeted/src/policy
SEDOMPROG=$SETARGETDIR/domains/program
SECONPROG=$SETARGETDIR/file_contexts/program

if [ -x /usr/sbin/semodule ] ; then
/usr/sbin/semodule -i /usr/share/mysql/policy/selinux/mariadb.pp
fi

if [ -x sbin/restorecon ] ; then
sbin/restorecon -R var/lib/mysql
fi
preuninstall scriptlet (using /bin/sh):
if [ $1 = 0 ] ; then
# Stop MySQL before uninstalling it
if [ -x /etc/init.d/mysql ] ; then
/etc/init.d/mysql stop > /dev/null
fi
# Don't start it automatically anymore
if [ -x /sbin/chkconfig ] ; then
/sbin/chkconfig --del mysql
fi
fi

# We do not remove the mysql user since it may still own a lot of
# database files.
postuninstall scriptlet (using /bin/sh):
if [ $1 -ge 1 ]; then
if [ -x /etc/init.d/mysql ] ; then
# only restart the server if it was alredy running
if /etc/init.d/mysql status > /dev/null 2>&1; then
/etc/init.d/mysql restart
fi
fi
fi

if [ $1 = 0 ] ; then
if [ -x /usr/bin/systemctl ] ; then
/usr/bin/systemctl daemon-reload > /dev/null 2>&1
fi
fi

4.最后一步,删除MariaDB-server:

rpm -e --noscripts MariaDB-server-10.1.22-1.x86_64

参考:http://blog.chinaunix.net/uid-631981-id-3787314.html

卸载Mariadb-报错的更多相关文章

  1. 安装mariadb报错: Job for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

    卸载和删除都使用过了,没有起到效果,然后用了如下的方案,进行解决: CentOS 从 Yum 源安装配置 Mariadb 2017.03.01 WangYan 学习笔记  热度 7℃ 一.安装 Mar ...

  2. MariaDB报错Plugin 'InnoDB' init function returned error.解决方案

    重新安装MariaDB后,服务一直启动不起来,查看日志有以下错误: InnoDB: No valid checkpoint found. InnoDB: If you are attempting d ...

  3. python连接mariadb报错解决1045, "Access denied for user 'root'@'192.168.0.50' (using password: YES)

    [root@localhost ~]# python Python 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Ha ...

  4. CentOS7.3yum安装MariaDB报错[Errno 256]

    在yum安装MariaDB时出现下面这个错误提示,然后着手排查,先检查了/etc/yum.repo.d/下的配置文件,没有错误. failure: repodata/repomd.xml from m ...

  5. Sql Server 2008卸载后再次安装一直报错

    sql server 2008卸载之后再次安装一直报错问题. 第一:由于上一次的卸载不干净,可参照百度完全卸载sql server2008 的方式 1. 用WindowsInstaller删除所有与S ...

  6. Mariadb 10.1 joiner节点加入报错WSREP: Failed to prepare for incremental state transfer

    Mariadb 10.1 galera cluster 集群joiner 节点加入集群 会出现这种报错,导致mysql一直点点点,这里我贴出报错.2016年04月19日13:34:58 2016-04 ...

  7. MySQL or MariaDB 错误解决方法之报错代码1045

    phpMyAdmin登录报错:mysqli_real_connect(): (28000/1045): Access denied for user 'root'@'localhost' (using ...

  8. mariadb启动报错:[ERROR] Can't start server : Bind on unix socket: Permission denied

    今天mariadb总是启动不了,对于我来说是不能忍受的.然后前往日志文件查看报错信息,提示如下: 出错信息一共就这三行,没有报其他的错误.那只能从红色方框的地方开始入手了. 首先是百度去搜索原因是什么 ...

  9. python的卸载方式和运行yum报错:No module named yum

    公司测试机环境不知道给我卸了什么包,导致yum运行报错状况: 系统版本:Red Hat Enterprise Linux Server release 6.2 (Santiago) 内核版本:2.6. ...

  10. vs2010一运行就报错deven.exe assert failure 解决方法,卸载系统中.netFramework最新版本的(简体中文)

    vs2010一运行就报错deven.exe assert failure 解决方法,卸载系统中.netFramework最新版本的(简体中文)

随机推荐

  1. iOS 如何优化项目

    原文 前言 在项目业务趋于稳定的时候,开发完迭代需求后,我们可能会无所适从,进入一段空白期,但是对于攻城狮来说闲暇不是件好事,所以我们可能总想学点什么,却又没有头绪.这个时候我们就可以考虑完善和优化我 ...

  2. Windows定位窗口对应的exe文件

    一.说明 以下两种情况我们会想要定位窗口是由哪个exe文件,或者什么命令启用 第一种是:广告窗口,现在经常时不时冒出一个广告窗口,要么是完全看不出哪个程序启动,要么是虽然大概知道是哪个应用启动(比如w ...

  3. Win10系列:UWP界面布局基础4

    类型转换 前面讲到过,在定义元素时可以通过Attributes特性方式为其设置属性并为属性赋值,在实际开发中所赋予的值可能和属性本身的数据类型不相符,这时XAML解析器就会使用类型转换器(Type C ...

  4. centos7.0 64位系统 安装PHP5.3 支持 nginx

    1  安装PHP所需要的扩展 yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel curl cur ...

  5. Python Oracle连接与操作封装

    一.封装方式一 #encoding:utf-8 import cx_Oracleclass Oracle_Status_Output:    def __init__(self,db_name,db_ ...

  6. linux系统安装tomcat详细配置

    1.通过ssh工具将apache-tomcat-7.0.85.tar.gz拖拽到 /home文件下 2.切换到/home 目录下 3.解压 指令 tar -zvxf apache-tomcat-7.0 ...

  7. Android开发 ---如何操作资源目录中的资源文件2

    Android开发 ---如何操作资源目录中的资源文件2 一.颜色资源管理 效果图: 描述: 1.改变字体的背景颜色 2.改变字体颜色 3.改变按钮颜色 4.图像颜色切换 操作描述: 点击(1)中的颜 ...

  8. js实现网页全屏切换(平滑过渡),鼠标滚动切换

    实现效果为页面平滑过渡全屏切换,点击导航和鼠标滚动都可以切换. 效果图: html代码: <!DOCTYPE html> <html> <head lang=" ...

  9. <Spark><Advanced Programming>

    Introduction 介绍两种共享变量的方式: accumulators:聚集信息 broadcast variables:高效地分布large values 介绍对高setup costs任务的 ...

  10. springsecurity的remember me

    基于持久化的token的方法 实现原理:将生成的 token 存入 cookie 中并发送到客户端浏览器,待到下次用户访问系统时,系统将直接从客户端 cookie 中读取 token 进行认证. 实现 ...