1. Laden Sie das offizielle MySQL-Yum-Repository herunter
wget -i -c http:
//dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
2. Installieren Sie das offizielle Yum-Repository von MySQL
yum -y installiere mysql57-community-release-el7-10.noarch.rpm
3. Installieren Sie den MySQL-Server
yum -y installiere mysql-community-server
4. Entfernen Sie das offizielle Yum-Repository
yum -y entferne mysql57-community-release-el7-10.noarch
5. Konfigurieren Sie den MySQL-Server
5.1 Passwort anzeigen
semanage fcontext -a -t mysqld_db_t "/vdata/mysqldata(/.*)?"
restaurierencon -Rv /vdata/mysqldata/
systemctl startet mysqld
grep "password" /var/log/mysqld.log
5.2 更改密码
set
global validate_password_policy=0;
set
global validate_password_length=1;
ALTER USER
'root'
@
'localhost'
IDENTIFIED BY
'new password'
;
5.3 开启远程访问
GRANT ALL ON *.* TO root@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
Flush-Berechtigungen;
5.4 Firewall-Konfiguration hinzufügen
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload