1.确保centos安装了wget,没有的话安装wget yum install wget 2.下载mysql的repo源 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 3.安装mysql-community-release-el7-5.noarch.rpm包 rpm -ivh mysql-community-release-el7-5.noarch.rpm 4.安装这个包后,会获得两个mysql的yum repo源 [root@localhost ~]# ls -1 /etc/yum.repos.d/mysql-community* /etc/yum.repos.d/mysql-community.repo /etc/yum.repos.d/mysql-community-source.repo [root@localhost ~]# 5.然后安装mysql yum install mysql-server 根据步骤安装就可以了,不过安装完成后,没有密码,需要充值密码: mysql_secure_installation 可以根据这个命令,重置密码。也可以登录mysql再重置 mysql -u root 根据mysql的命令行来更改: mysql> use mysql; mysql> update user set password=PASSWORD("GIVE-NEW-ROOT-PASSWORD") where User='root'; mysql> flush privileges; mysql> quit

分类: web

标签: