centos 安装mysql

先卸载自带的mariadb

rpm -qa | grep mariadb

centos 安装mysql

rpm -e --nodeps mariadb-libs-5.5.64-1.el7.x86_64

安装包

mysql-community-common-5.7.24-1.el7.x86_64.rpm

mysql-community-libs-5.7.24-1.el7.x86_64.rpm

mysql-community-libs-compat-5.7.24-1.el7.x86_64.rpm

mysql-community-client-5.7.24-1.el7.x86_64.rpm

mysql-community-server-5.7.24-1.el7.x86_64.rpm

 

  1. 依次安装软件包

rpm –ivh mysql-community-common-5.7.24-1.el7.x86_64.rpm

rpm –ivh mysql-community-libs-5.7.24-1.el7.x86_64.rpm

rpm –ivh mysql-community-libs-compat-5.7.24-1.el7.x86_64.rpm

rpm –ivh mysql-community-client-5.7.24-1.el7.x86_64.rpm

rpm –ivh mysql-community-server-5.7.24-1.el7.x86_64.rpm

报错:/usr/bin/perl is needed by mysql-community-server-5.7.19-1.el7.x86_64

缺少net-tools.x86_64,libaio.x86_64,perl.x86_64三个依赖,使用yum安装即可。

  1. yum -y install perl.x86_64

  2. yum install -y libaio.x86_64

  3. yum -y install net-tools.x86_64

  1. 启动数据库

service mysqld start

  1. 获取root用户的临时密码

grep 'temporary password' /var/log/mysqld.log | awk -F' ' '{print $NF}'

参考:https://www.cnblogs.com/lic1005/archive/2004/01/13/7989775.html

上一篇:linux安装mysql8


下一篇:winform 代码定义事件