Uninstall mariadb-Error

Source: Internet
Author: User

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 is 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. View dependencies:

Rpm-q-scripts mariadb-server-10.1.22-1.x86_64

Preinstall Scriptlet (using/bin/sh):
# Check If we can safely upgrade. An upgrade are 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, 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
Be safe in all cases. A manual dump and restore using mysqldump is
Recommended. It's important to review the MariaDB manual ' s upgrading
Section for version-specific incompatibilities.
"
Fi

If [-N "$error _text"]; Then
Cat <

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

-Ensure that there is 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 would
List the packages you should remove:
Rpm-qa | Grep-i ' ^mysql-'

Choose to use ' rpm--nodeps-ev <package-name> ' to remove
The package which contains the Mysqlclient shared library. The
Library is reinstalled by the mariadb-shared package.
-Install The new MariaDB packages supplied by $myvendor
-Ensure the MariaDB server is started
-Run the ' Mysql_upgrade ' program

This is a brief description of the upgrade process. Important Details
Can is 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 are down
if [$ = 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 if the machine does it.
if [$ = 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 relative to a basedir!
if! Expr $datadir:/>/dev/null; Then
datadir= $basedir/$datadir
Fi
Fi

# Create A MySQL user and group. 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 is 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, the user that'll 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, 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 [$ = 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 could 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 is alredy running
If/etc/init.d/mysql Status >/dev/null 2>&1; Then
/etc/init.d/mysql restart
Fi
Fi
Fi

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

4. Last step, delete mariadb-server:

RPM-E--noscripts mariadb-server-10.1.22-1.x86_64

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

Uninstall mariadb-Error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.