廢話不多說,直接開始
1.?下載mysql源安裝包命令:wget?https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm?
2.?yum localinstall?mysql80-community-release-el7-1.noarch.rpm?
3.?檢測mysql是否安裝完成: yum repolist enabled | grep "mysql.*-community.*"
4.?安裝mysql: yum install mysql-community-server
5.?設(shè)置開啟啟動mysql服務(wù):systemctl enable mysqld
6.?查看安裝的mysql版本:rpm -aq | grep -i mysql
7.?啟動MySQL服務(wù):systemctl start mysqld
8.?查看MySQL初始密碼:grep 'A temporary password' /var/log/mysqld.log
9.?使用已經(jīng)獲得到的臨時密碼登陸mysql: mysql -u root -p
10.?修改密碼認(rèn)證強(qiáng)度:set global validate_password.policy=0;
11.?修改mysql密碼: ALTER USER "root"@"localhost" IDENTIFIED? BY '你的新密碼';?需要有引號起意!
安裝完畢 :)
其他命令:?service mysqld start? | service mysqld stop | service mysqld restart