成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

Linux安裝MariaDB數(shù)據(jù)庫的實例詳解

瀏覽:188日期:2023-03-30 13:21:09

1. 下載MariaDB數(shù)據(jù)庫

測試: 當前虛擬機是否可以正確的鏈接外網(wǎng).

命令:

[root@localhost src]# yum install mariadb-server 安裝mariadb數(shù)據(jù)庫[root@localhost src]# yum clean all  清空已安裝文件 如果下載失敗之后執(zhí)行的.

2 確認下載

3 安裝完成提示

4 數(shù)據(jù)庫啟動

命令:

1. 啟動命令 [root@localhost src]# systemctl start mariadb
2. 重啟命令 [root@localhost src]# systemctl restart mariadb
3. 關(guān)閉命令 [root@localhost src]# systemctl stop mariadb

5. 數(shù)據(jù)庫初始化操作

命令:

6. 測試數(shù)據(jù)庫用戶名和密碼是否有效

7.導(dǎo)入數(shù)據(jù)表

說明:如果mysql數(shù)據(jù)庫需要導(dǎo)入數(shù)據(jù)表命令如下:
命令:

source /xxx/xxxx/xxxx/jtdb.sql;

8.Mysql數(shù)據(jù)庫遠程訪問配置

8.1 關(guān)于鏈接數(shù)據(jù)庫的說明

說明:
1. 如果需要遠程鏈接數(shù)據(jù)庫必須通過防火墻
2. 如果遠程鏈接數(shù)據(jù)庫,數(shù)據(jù)庫中必須開啟遠程訪問權(quán)限才行,否則拒絕鏈接.

8.2 配置數(shù)據(jù)庫權(quán)限配置說明

8.3 配置Linux數(shù)據(jù)庫權(quán)限 8.3.1 切換數(shù)據(jù)庫mysql

切換Mysql數(shù)據(jù)庫

8.3.2 修改數(shù)據(jù)庫表

1).檢查數(shù)據(jù)表

2).查詢user表中的host/root/password

3).將host=“l(fā)ocalhost” 改為 “%”

4).刷新數(shù)據(jù)庫權(quán)限

9. 配置Linux防火墻策略 9.1 檢查防火墻狀態(tài)

命令:

firewall-cmd --state

9.2 防火墻配置

說明:防火墻中有一個配置文件,表示當Linux系統(tǒng)啟動時防火墻應(yīng)該如何操作!!!
需求: 告訴linux系統(tǒng)以后開機不需要啟動防火墻
命令:

systemctl disable firewalld.servicesystemctl enable firewalld.service

9.3 手動關(guān)閉防火墻

說明:通過命令手動將防火墻關(guān)閉
命令:

systemctl stop firewalld.servicesystemctl start firewalld.service

9.4 手動開放防火墻端口

1). 檢查防火墻開放的端口

firewall-cmd --list-ports

2).檢查端口是否開放

firewall-cmd --query-port 80/tcp

3). 開啟防火墻

firewall-cmd --zone=public --add-port=80/tcp --permanent

4).移除端口

firewall-cmd --zone=public --remove-port=9090/tcp --permanent

5).關(guān)于防火墻操作的解釋
–zone #作用域

–add-port=80/tcp #添加端口,格式為:端口/通訊協(xié)議

–remove-port=80/tcp #移除端口,格式為:端口/通訊協(xié)議

–permanent #永久生效,沒有此參數(shù)重啟后失效

6).重啟防火墻

firewall-cmd --reload

9.4 數(shù)據(jù)庫遠程測試

9.5 導(dǎo)入jtdb.sql

到此這篇關(guān)于Linux安裝MariaDB數(shù)據(jù)庫的實例詳解的文章就介紹到這了,更多相關(guān)Linux安裝MariaDB內(nèi)容請搜索以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持!

標簽: MariaDB