centos6 只安裝mysql client(安裝包安裝和yum安裝mysql)
方法一下載安裝:
1、在/home創建mysql目錄,下載如下四個軟件包
http://mirrors.sohu.com/mysql/MySQL-5.7/
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-client-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-common-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-libs-5.7.18-1.el6.x86_64.rpm
wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-server-5.7.18-1.el6.x86_64.rpm
2、檢查mysql rpm相關的包是否安裝並去除
[root@centos-6 mysql]# rpm -qa | grep -i mysql
mysql-libs-5.1.73-8.el6_8.x86_64
[root@centos-6 mysql]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64
error: Failed dependencies:
libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
mysql-libs is needed by (installed) postfix-2:2.6.6-8.el6.x86_64
[root@centos-6 mysql]#
將依賴包一並刪除
[root@centos-6 mysql]# yum remove -y mysql-libs
再次查詢是否刪除乾淨
[root@centos-6 mysql]# rpm -qa | grep -i mysql
[root@centos-6 mysql]#
3、同時安裝這三個rpm包
rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm
方法二yum安裝:
首先要到MySQL yum庫的下載頁面http://dev.mysql.com/downloads/repo/yum/
下載:mysql57-community-release-el7-11.noarch.rpm
安裝:rpm -Uvh mysql57-community-release-el7-9.noarch.rpm
yum安裝server:
yum install mysql-community-server
yum安裝client:
yum install mysql-community-client