CentOS 7 Linux 卸载/安装 MySQL mysql 5.7

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS 7 Linux 卸载/安装 MySQL mysql 5.7相关的知识,希望对你有一定的参考价值。

#卸载mariadb/mysql 
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -qa | grep mariadb
mariadb-5.5.52-1.el7.x86_64
mariadb-devel-5.5.52-1.el7.x86_64
mariadb-server-5.5.52-1.el7.x86_64
mariadb-libs-5.5.52-1.el7.x86_64
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e akonadi-mysql-1.9.2-4.el7.x86_64
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e mariadb-server-1:5.5.52-1.el7.x86_64
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e mariadb-devel-5.5.52-1.el7.x86_64
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e mariadb-5.5.52-1.el7.x86_64
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e perl-DBD-MySQL-4.023-5.el7.x86_64
[[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e qt-mysql-1:4.8.5-13.el7.x86_64
#[[email protected] temp]# rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64 [[email protected] mysql
-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e --nodeps redhat-lsb-core-4.1-27.el7.centos.1.x86_64 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e postfix-2:2.10.1-6.el7.x86_64 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e qt3-MySQL-3.3.8b-51.el7.x86_64 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e qt5-qtbase-mysql-5.6.1-10.el7.x86_64 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e MySQL-python-1.2.5-1.el7.x86_64 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -e mariadb-libs-5.5.52-1.el7.x86_64 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -qa | grep mariadb [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -qa | grep mysql #到此完全卸载mariadb/mysql [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm 警告:mysql-community-server-5.7.18-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY 准备中... ################################# [100%] 正在升级/安装... 1:mysql-community-server-5.7.18-1.e################################# [100%] #启动服务 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# systemctl start mysqld @localhost init.d]# /bin/systemctl start mysqld.service [[email protected] init.d]# chkconfig mysqld on 注意:正在将请求转发到“systemctl enable mysqld.service”。 [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]$ rpm -ivh *rpm [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# /bin/systemctl start mysqld.service [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# sudo grep temporary password /var/log/mysqld.log 2017-04-20T09:35:38.412872Z 1 [Note] A temporary password is generated for [email protected]: LC(7rVrhSSrw [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 19 Server version: 5.7.18 Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type help; or \h for help. Type \c to clear the current input statement. mysql> ALTER USER root@localhost IDENTIFIED BY MyNewPass4!; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye [[email protected] mysql-5.7.18-1.el7.x86_64.rpm-bundle]# mysqladmin -p -u root shutdown Enter password:

 


以上是关于CentOS 7 Linux 卸载/安装 MySQL mysql 5.7的主要内容,如果未能解决你的问题,请参考以下文章

CentOS 7 Linux 卸载/安装 MySQL mysql 5.7

Centos6.5安装mysql-5.7.23

Centos 7 安装 和 卸载 Mysql5.7(压缩包)

MySQL | MySQL5.7.* 安装

Linux 的 CentOS 中彻底卸载 MySQL

在Linux 的 CentOS 中彻底卸载 MySQL