CentOS7 安裝mysql(YUM方式)

2022-03-13 10:23:33 字數 2265 閱讀 4490

2.安裝mysql源

3.檢查mysql源是否安裝成功

shell> yum repolist enabled | grep "mysql.*-community.*"

4.修改 vim /etc/yum.repos.d/mysql-community.repo源,改變預設安裝的mysql版本。比如要安裝5.6版本,將5.7源的enabled=1改成enabled=0。然後再將5.6源的enabled=0改成enabled=1即可。

5.安裝mysql

shell> yum install mysql-community-server

6.啟動mysql服務

shell> systemctl start mysqld

7.開機啟動

shell> systemctl enable mysqld

shell> systemctl daemon-reload

8.修改root本地登入密碼

1)檢視mysql密碼

shell> grep 'temporary password' /var/log/mysqld.log

2)連線mysql

3)修改密碼[注意:後面的分號一定要跟上]

mysql> alter user 'root'@'localhost' identified by 'mynewpass4!';

或者:mysql> set password for 'root'@'localhost'=password('wys111111!'); 

mysql> show variables like '%password%';

9.新增遠端登入使用者

mysql> grant all privileges on *.* to 'root'@'%' identified by 'wys111111!' with grant option;

2.安裝mysql源

3.檢查mysql源是否安裝成功

shell> yum repolist enabled | grep "mysql.*-community.*"

4.修改 vim /etc/yum.repos.d/mysql-community.repo源,改變預設安裝的mysql版本。比如要安裝5.6版本,將5.7源的enabled=1改成enabled=0。然後再將5.6源的enabled=0改成enabled=1即可。

5.安裝mysql

shell> yum install mysql-community-server

6.啟動mysql服務

shell> systemctl start mysqld

7.開機啟動

shell> systemctl enable mysqld

shell> systemctl daemon-reload

8.修改root本地登入密碼

1)檢視mysql密碼

shell> grep 'temporary password' /var/log/mysqld.log

2)連線mysql

3)修改密碼[注意:後面的分號一定要跟上]

mysql> alter user 'root'@'localhost' identified by 'mynewpass4!';

或者:mysql> set password for 'root'@'localhost'=password('wys111111!'); 

mysql> show variables like '%password%';

9.新增遠端登入使用者

mysql> grant all privileges on *.* to 'root'@'%' identified by 'wys111111!' with grant option;

centos7 安裝centos桌面

一 輸入命令 yum groupinstall gnome desktop graphical administration tools 二 設定系統啟動等級。systemctl get default 獲取當前系統執行形式,會顯示multi user.target 命令列終端 或者 graphic...

centos7安裝nginx(yum安裝)

感興趣的可以檢視用壓縮包安裝的過程 1 通過檢視當前linux核心以及版本號進行獲取nginx的rpm安裝源適配。uname a2 獲取nginx相關的rpm源 防止版本號不對應產生的各種問題 rpm uvh3 yum安裝nginx yum install nginx等待安裝完成。1 安裝完成後,n...

CentOS7安裝docker(yum安裝)

1.中文文件 2.檢視linux版本 cat etc redhat release3.是否聯網 這裡yun安裝,不聯網gg 4.解除安裝舊版本 sudo yum remove docker docker client docker client latest docker common docker...