一.
wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
二.
yum -y localinstall mysql57-community-release-el7-11.noarch.rpm
三.
yum -y install mysql-community-server
四.
systemctl start mysqld<br>ps -ef | grep mysql
五.mysql默認密碼
cat /var/log/mysqld.log
登陸
mysql -uroot -pykO:DNGXx5ee
七.修改默認密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Qwe340721@';
設置允許遠程登錄
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Qwe340721@' WITH GRANT OPTION;
退出
exit;
八.防火墻開放3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
九.配置mysql默認編碼為utf-8
vim /etc/my.cnf<br><br>
character_set_server=utf8
init_connect='SET NAMES utf8'
十.重啟服務
systemctl restart mysqld
以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。