欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時(shí)間:2020年11月30日 11:16:55   作者:閃耀太陽  
這篇文章主要介紹了Linux安裝MariaDB數(shù)據(jù)庫的實(shí)例詳解,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

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

測試: 當(dāng)前虛擬機(jī)是否可以正確的鏈接外網(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ù)庫啟動(dòng)

命令:

1.   啟動(dòng)命令    [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ù)庫遠(yuǎn)程訪問配置

在這里插入圖片描述

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

說明:
1. 如果需要遠(yuǎn)程鏈接數(shù)據(jù)庫必須通過防火墻
2. 如果遠(yuǎn)程鏈接數(shù)據(jù)庫,數(shù)據(jù)庫中必須開啟遠(yuǎn)程訪問權(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 防火墻配置

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

systemctl disable firewalld.service
systemctl enable firewalld.service

在這里插入圖片描述

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

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

systemctl stop firewalld.service
systemctl start firewalld.service

在這里插入圖片描述

9.4 手動(dòng)開放防火墻端口

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ù)庫遠(yuǎn)程測試

在這里插入圖片描述

9.5 導(dǎo)入jtdb.sql

在這里插入圖片描述

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

相關(guān)文章

最新評論