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. 调整innodb redo log files数目和大小的具体方法和步骤

    相较于Oracle的在线调整redo日志的数目和大小,mysql这点则有所欠缺,即使目前的mysql80版本,也不能对innodb redo日志的数目和大小进行在线调整,下面仅就mysql调整inno ...

  2. 由于 Exception.tostring()失败,因此无法打印异常字符串

    console程序执行错误时,不显示异常信息. 解决方法: 在命令行修改显示字符格式  chcp 936

  3. 【转】Windows守护进程的一种简单实现

    一讲到守护进程,很多人都想到了Linux系统,确实在Windows上这个说的比较少.今天上午群里有个朋友问我了下Windows下守护进程的实现问题,我想了想,简单用C++写了个小例子,用来实现系统开机 ...

  4. linux下iostat命令详解

    iostat用于输出CPU和磁盘I/O相关的统计信息 iostat语法 用法:iostat [ 选项 ] [ <时间间隔> [ <次数> ]] 常用选项说明: -c:只显示系统 ...

  5. 【CSV文件】CSV文件内容读取

    CSV(逗号分隔值文件格式) 逗号分隔值(Comma-Separated Values,CSV,有时也称为字符分隔值,因为分隔字符也可以不是逗号),其文件以纯文本形式存储表格数据(数字和文本).纯文本 ...

  6. Vue + Element UI 实现权限管理系统 (管理应用状态)

    使用 Vuex 管理应用状态 1. 引入背景 像先前我们是有导航菜单栏收缩和展开功能的,但是因为组件封装的原因,隐藏按钮在头部组件,而导航菜单在导航菜单组件,这样就涉及到了组件收缩状态的共享问题.收缩 ...

  7. bzoj1666

    题解: 简单模拟 按照题目意思来就可以了 代码: #include<bits/stdc++.h> using namespace std; int n,ans; int main() { ...

  8. 【转载】OpenCV 摄像头控制

    参考:[OpenCV] -- 简单摄像头操作 - 代码人生 - 博客频道 - CSDN.NET http://blog.csdn.net/qiurisuixiang/article/details/8 ...

  9. 离线安装docker镜像

    假如由于网络原因,需要在一台无网络的电脑上运行镜像,那么docker是支持的. 你需要做的主要有3步骤: 1:先从一个有网络的电脑下载docker镜像 sudo docker pull ubuntu ...

  10. Cracking The Coding Interview 1.6

    //原文: // // Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, w ...