Linux安裝MariaDB數(shù)據(jù)庫的實例詳解
1. 下載MariaDB數(shù)據(jù)庫
測試: 當(dāng)前虛擬機是否可以正確的鏈接外網(wǎng).

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

2 確認(rèn)下載

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 防火墻配置
說明:防火墻中有一個配置文件,表示當(dāng)Linux系統(tǒng)啟動時防火墻應(yīng)該如何操作!!!
需求: 告訴linux系統(tǒng)以后開機不需要啟動防火墻
命令:
systemctl disable firewalld.service systemctl enable firewalld.service

9.3 手動關(guān)閉防火墻
說明:通過命令手動將防火墻關(guān)閉
命令:
systemctl stop firewalld.service systemctl 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)文章希望大家以后多多支持腳本之家!
相關(guān)文章
MongoDB啟動報錯 28663 Cannot start server
今天學(xué)習(xí)mongoDB的時候,啟動總是失敗,搜了好久找到這個文檔解決了問題,是引擎的問題,需要的朋友可以參考下2020-02-02
Windows10系統(tǒng)下安裝MariaDB 的教程圖解
MariaDB由MySQL的創(chuàng)始人麥克爾·維德紐斯主導(dǎo)開發(fā),他早前曾以10億美元的價格,將自己創(chuàng)建的公司MySQL賣給了SUN,此后,隨著SUN被甲骨文收購,MySQL的所有權(quán)也落入Oracle的手中。這篇文章給大家介紹Windows10系統(tǒng)下安裝MariaDB 的教程圖解,感興趣的朋友一起看看吧2018-12-12
Window7安裝MariaDB數(shù)據(jù)庫及系統(tǒng)初始化操作分析
這篇文章主要介紹了Window7安裝MariaDB數(shù)據(jù)庫及系統(tǒng)初始化操作,簡明扼要的分析了Windows7平臺上安裝mariadb數(shù)據(jù)庫的步驟、配置方法及相關(guān)注意事項,需要的朋友可以參考下2018-05-05

