智一面初中级Linux运维工程师在线评测:http://www.gtalent.cn/exam/interview/eUrdXoILlsGnh6At

安装 

# 安装前置依赖
yum install wget perl net-tools -y
# 卸载 mariadb-libs
rpm -e --nodeps  mariadb-libs.x86_64
# 创建文件夹
mkdir mysql
# 进入文件夹
cd mysql
# 下载mysql安装所需文件
wget https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el6-x86_64/mysql-community-client-5.7.10-1.el6.x86_64.rpm https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el6-x86_64/mysql-community-libs-5.7.10-1.el6.x86_64.rpm https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el6-x86_64/mysql-community-common-5.7.10-1.el6.x86_64.rpm https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql-5.7-community-el6-x86_64/mysql-community-server-5.7.10-1.el6.x86_64.rpm
# 按顺序安装程序
rpm -ivh mysql-community-libs-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-server-5.7.10-1.el6.x86_64.rpm
# 修改权限
chmod 777 -R /var/lib/mysql/
# 重启mysql
service mysqld restart
# 查看mysql安装时生成的密码
grep 'temporary password' /var/log/mysqld.log
# 登录mysql
mysql -u root -p

卸载

卸载前可以先查看程序名称

yum list installed

 或者直接运行以下命令

rpm -e --nodeps mysql-community-server.x86_64 mysql-community-client.x86_64 mysql-community-common.x86_64 mysql-community-libs.x86_64

【王老师说运维】:运维之linux基础入门实战