mysql5.7安裝(yum在線方式)


安裝
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server
systemctl start mysqld

修改密碼

 

找到初始密碼
grep 'temporary password' /var/log/mysqld.log
2020-04-11T07:53:15.951160Z 1 [Note] A temporary password is generated for root@localhost: g(wfb5Nhf.2L

登錄修改密碼
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY '1qaz@WSX';

開啟遠程

mysql -u root -p
show databases;
use mysql;
show tables;
update user set Host='%' where User='root';
grant all privileges on *.* to root@"192.168.1.9" identified by "1qaz@WSX";
flush privileges;

配置默認編碼為utf8

vi /etc/my.cnf
#添加 [mysqld] 
character_set_server=utf8 
init_connect='SET NAMES utf8'

重啟/設置開機啟動

systemctl restart mysqld
systemctl enable mysqld 

 

參考:
https://blog.csdn.net/wohiusdashi/article/details/89358071


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM