1.下載 安裝MySQL官方y(tǒng)um 倉庫。
[root]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm [root]# yum -y install mysql57-community-release-el7-10.noarch.rpm
2.安裝MySQL服務(wù)器
[root]# yum -y install mysql-community-server
3.MySQL數(shù)據(jù)庫設(shè)置
[root]# systemctl start mysqld.service #開啟mysql服務(wù)
4.設(shè)置自動啟動
[root]# systemctl enable mysqld
5.查看初始化數(shù)據(jù)庫密碼
[root]# grep "password" /var/log/mysqld.log
畫圈處就是初始化的密碼
6.登錄Mysql
[root]# mysql -u root -p
7.修改密碼
[root]# ALTER USER 'root'@'localhost' IDENTIFIED BY '**********';
mysql 下,現(xiàn)在的root用戶授權(quán)是只能本地登入,如果想網(wǎng)絡(luò)登入需要授權(quán)。






