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. Android Studio打包生成APK教程

    一.修改版本和指定生成APK文件名[可选] 将项目切换到Project视图,打开app目录下的build.gradle文件 1.1 修定软件版本 如1.2图所示. versionCode是app的大版 ...

  2. Wireshark:No interfaces found解决方法(Windows 10)

    启动Wireshark时有时会报“No interfaces found”,找不到网卡进行截包.造成这种情况的原因可能有两个,一是npf服务没启动,二是当前用启对网卡没有拦截权限. 一.npf服务未启 ...

  3. c++ count函数

    count函数 algorithm头文件(#include <algorithm>)定义了一个count的函数,其功能类似于find.这个函数使用一对迭代器和一个值做参数,返回这个值出现次 ...

  4. mac crontab时间断内随机时间执行定时任务

    首先需要了解crontab使用,这里不多,主要是时间断内随机时间: 然而crontab 并没有具体方法实现时间段内随机时间执行,我的办法如下: 这里测试一个例子: 执行一个数据存文件python脚本, ...

  5. ubuntu16.10 安装ibus中文输入法

    安装以下几种常用输入法: IBus拼音:sudo apt-get install ibus-pinyin IBUS五笔:sudo apt-get install ibus-table-wubi 谷歌拼 ...

  6. Win10系列:JavaScript页面导航

    页面导航是在开发应用的过程中使用频率较高的技术,其中比较常用的导航方式有多页导航和页内导航,采用多页导航方式的应用程序包含一系列的页面,在一个页面中加入另一个页面的链接地址后,单击链接将跳转到指定页面 ...

  7. C++解析七-重载运算符和重载函数

    重载运算符和重载函数C++ 允许在同一作用域中的某个函数和运算符指定多个定义,分别称为函数重载和运算符重载.重载声明是指一个与之前已经在该作用域内声明过的函数或方法具有相同名称的声明,但是它们的参数列 ...

  8. Java反射《四》获取方法

    package com.study.reflect; import java.lang.reflect.InvocationTargetException; import java.lang.refl ...

  9. [转载]mysqlcreate新建用户host使用%,本地无法连接原因及解决方法

    转载自 http://www.2cto.com/database/201307/225781.html mysql,因为root权限过高,所以新建一用户appadmin,权限仅为要用到的数据库.创建语 ...

  10. 九. Python基础(9)--命名空间, 作用域

    九. Python基础(9)--命名空间, 作用域 1 ● !a 与 not a 注意, C/C++可以用if !a表示if a == 0, 但是Python中只能用if not a来表示同样的意义. ...