4.检查系统是否安装有mysql的安装包,如果有使用rpm -e 移除
[root@OperationsAnalysis ~]# rpm -qa| grep mysql
或者
1
[root@localhost ~]
# rpm -qa | grep -i mysql
2
mysql-libs-5.1.66-2.el6_3.x86_64
3
[root@localhost ~]
# yum -y remove mysql-libs*
5.下载mysql5.6的安装包,并上传到服务器上
[root@OperationsAnalysis mysql]# ll
total 236180
-rw-r--r-- 1 root root 20278972 Sep 22 15:41 MySQL-client-5.6.31-1.el7.x86_64.rpm -rw-r--r-- 1 root root 3529244 Sep 22 15:40 MySQL-devel-5.6.31-1.el7.x86_64.rpm -rw-r--r-- 1 root root 92246408 Sep 22 15:44 MySQL-embedded-5.6.31-1.el7.x86_64.rpm -rw-r--r-- 1 root root 61732192 Sep 22 15:42 MySQL-server-5.6.31-1.el7.x86_64.rpm -rw-r--r-- 1 root root 2101912 Sep 22 15:42 MySQL-shared-5.6.31-1.el7.x86_64.rpm -rw-r--r-- 1 root root 2299648 Sep 22 15:40 MySQL-shared-compat-5.6.31-1.el7.x86_64.rpm -rw-r--r-- 1 root root 59644132 Sep 22 15:40 MySQL-test-5.6.31-1.el7.x86_64.rpm
6.安装mysql 的安装包
[root@OperationsAnalysis mysql]# rpm -ivh MySQL-server-5.6.31-1.el7.x86_64.rpm [root@OperationsAnalysis mysql]# rpm -ivh MySQL-devel-5.6.31-1.el7.x86_64.rpm [root@OperationsAnalysis mysql]# rpm -ivh MySQL-client-5.6.31-1.el7.x86_64.rpm
rpm安装默认目录:
数据文件:/var/lib/mysql/
配置文件模板:/usr/share/mysql
mysql客户端工具目录:/usr/bin
日志目录:/var/log/
pid,sock文件目录:/tmp/
一般配置文件会放置在/etc下