linux下yum安裝mysql數(shù)據(jù)庫
1.先打開mysql官網(wǎng)找到如下圖所示 點擊這里
2.找到本頁面最下方選擇下載
3.下載完成后上傳服務器,安裝mysql源---自己更換下載的文件名稱
yum localinstall mysql57-community-release-el7-8.noarch.rpm
4.修改mysql源--- /etc/yum.repos.d/mysql-community.repo
改變默認安裝的mysql版本盖桥。比如要安裝5.6版本,將5.6源的enabled=0改成enabled=1醋奠,然后將其他源的enabled=1改成enabled=0即可牧抵。
5.安裝mysql
yum install mysql-community-server
6.啟動mysql
systemctl start mysqld
7.查看mysql密碼---
grep 'temporary password' /var/log/mysqld.log
8.重置mysql密碼123456為新密碼
alter user user() identified by "123456";
9.給mysql數(shù)據(jù)庫增加遠程訪問用戶和權限
CREATE USER 'mysql'@'%' IDENTIFIED BY 'Admin_888';
grant all privileges on *.* to 'mysql'@'%' identified by 'Admin_888';
FLUSH PRIVILEGES;