本人最煩安裝配置服務了!mysql
下載安裝msyql的repo源
[root@yzj ~]# wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmsql
[root@yzj ~]# yum -y install mysql-community-release-el7-5.noarch.rpm數據庫
安裝MySQL
[root@yzj ~]# yum -y install mysql-servercentos
驗證下安裝
[root@yzj ~]# rpm -qa | grep mysqlide
開啓MySQL服務
[root@yzj ~]# systemctl start mysql3d
MySQL有個最初的密碼
[root@yzj ~]# grep "password" /var/log/mysqld.log
code
[root@yzj ~]# mysql -uroot -p‘複製的密碼粘貼進來’server
輸入初始密碼後須要更改密碼才能操做數據庫
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';blog
注意:若是密碼設置的簡單會報錯,應爲MySQL有設置密碼的規則,請自行百度解決get