資料庫服務基礎
常見的關係型,資料庫管理系統。
1.微軟的sql server
2.ibm的db2
3.甲骨文的oracle mysql
4.社群開源版mariadb
5.rhel7中的mariadb相關包
mariadb-server 提供服務端有關的系統程式
埠號:3306
一、部署mariadb資料庫
1.安裝mariadb-server資料庫軟體
yum -y install mariadb-server
2..資料庫主配置檔案路徑/etc/my.cnf
3.啟動mariadb服務
4.命令
mysql 進入資料庫
show databases; 檢視資料庫
create database abc; 建立資料庫
drop database abc; 刪除資料庫
use 資料庫名; 使用/選擇資料庫
show tables; 列出資料庫的**
quit 退出資料庫
資料庫管理員為root,但是與系統使用者root沒有任何關係。
為資料庫賬號新增/修改密碼:
格式: mysqladmin -u 使用者名稱 -p密碼 password 『新密碼』
例: mysqladmin -u root password '456' (建立密碼)
mysqladmin -u root -p456 password '123'(修改密碼)
mysql -u root -p123 (免互動登入)
禁止監聽,只服務於本機的設定。
vim /etc/my.cnf 資料庫主配置檔案
skip-networking 跳過網路監聽
systemctl restart mariadb 重啟服務
匯入/恢復到資料庫
mysql -u 使用者名稱 -p密碼 資料庫名 < 備份檔案.sql
查詢操作:
select * from base;
select * from location;
select id,name from base;
例: mysqkl -u root -p123 (進入資料庫)
use abc;
select * from base where name='tom';(查詢人名)
select * from location where city='beijing';(查詢城市)
資料庫授權
格式:grant 許可權 on 資料庫名.表名 to 使用者@localhost
indentified by '密碼';
例: grant select on abc.* lisi@localhost indentified by '123';
當使用者lisi從本地localhost登入,輸入密碼123,將會獲得庫abc所有表的查詢許可權。
資料庫境像服務
sql server 2005中最新加入了資料庫映象技術,該技術可以為資料庫提供冗餘的副本,在主資料庫無法訪問的情況下使用者可以訪問映象資料庫從而保證資料庫的有效訪問,要實現該技術需要主伺服器 見證伺服器和映象伺服器三者相互配合 為了配合sql server 2005中的資料庫映象技術,在.net ...
資料庫服務概述
資料庫型別 資料庫是 按照資料結構來組織 儲存和管理資料的倉庫 是乙個長期儲存在計算機內的 有組織的 有共享的 統一管理的資料集合。簡單來說資料庫一般是用來存放metadata 元資料 比如一般不會被存放在資料庫中,而存放在磁碟中,但一般用資料庫儲存放這張的存放路徑.dbms database ma...
資料庫服務 搭建
mysql關係型資料庫管理系統 特點功能強大 速度快 效能優越 穩定性強 使用簡單 管理方便 mysql忘記密碼 1 停止服務 systemctl stop mariadb.service 2 找主配置檔案 etc my.cnf symbolic links 0後 加上skip grant tabl...