mysql rpm安装
1 卸载
rpm -qa | grep mysql
rpm -e mysql-community-server-5.7.16-1.el7.x86_64
rpm -e mysql-community-libs-5.7.16-1.el7.x86_64
rpm -e mysql-community-client-5.7.16-1.el7.x86_64
rpm -e mysql-community-libs-5.7.16-1.el7.x86_64
rpm -e mysql-community-libs-5.7.16-1.el7.x86_64
rm -rf /etc/logrotate.d/mysql
rm -rf /etc/selinux/targeted/active/modules/100/mysql
rm -rf /etc/selinux/targeted/tmp/modules/100/mysql
rm -rf /var/lib/pcp/config/pmlogconf/mysql
rm -rf /var/lib/mysql
rm -rf /var/lib/mysql/mysql
rm -rf /usr/bin/mysql
rm -rf /usr/lib/python2.7/site-packages/azure/mgmt/rdbms/mysql
rm -rf /usr/lib/python2.7/site-packages/clufter/filters/cluster/rm/mysql
rm -rf /usr/lib/ocf/resource.d/heartbeat/mysql
rm -rf /usr/lib64/mysql
rm -rf /usr/share/mysql
rm -rf /usr/share/resource-agents/ocft/configs/mysql
2 安装
cd /opt/mysql/
rpm -ivh mysql-community-common-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.16-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.16-1.el7.x86_64.rpm
3 修改数据文件路径 /etc/my.cnf
datadir=/home/data/
4.关闭selinux(缺少这步操作可能会导致mysqld 无法启动)
setenforce 0
5.启动mysqld
service mysqld start