您好,登錄后才能下訂單哦!
環境
OS:CentOS7.6
Mysql:Mysql5.7
#下載mysql源安裝包
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
#安裝mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
#檢測源是否安裝成功
yum repolist enabled | grep "mysql.*-community.*"
#Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
yum安裝
yum install mysql-community-server
systemctl start mysqld //啟動mysql服務
systemctl status mysqld
systemctl enable mysqld
systemctl daemon-reload //重載服務
mysql> set password for 'root'@'localhost'=password('xxxxxxxx');
查看密碼策略:
mysql> show variables like '%password%'
0 => LOW,1 => MEDIUM,2 => STRONG
命令行修改:
set global validate_password_policy=0; //設置密碼策略等級
set global validate_password_length=6; //設置密碼最小長度
重啟mysql服務
systemctl restart mysqld
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。