資料庫知識點

2021-08-25 17:00:01 字數 1255 閱讀 9777

oracle

安裝oracle時需要的所需的軟體包安裝命令

yum install binutils* compat-libcap1* gcc* glibc* ksh libaio* libgcc* libstdc++* libxi* libxtst* make* sysstat*

1 建使用者create user    oracle(使用者名稱) identified by password(密碼是數字時加引號);

2 grant resource,connect, dba to oracle(使用者名稱); 加許可權

3 oracle登入使用者

connect oracle/123456(使用者名稱/密碼)

4 建表

create table test(id number(2) not null,name varchar(20),age number(2),ach number(2));

5 遠端登陸mysql

遠端登入oracle資料庫[oracle@localhost ~]$ sqlplus oracle/123456@

mysql

修改mariadb的root密碼

use mysql;

update user set password = password('123456')  where user = 'root';

1 增加使用者並授權的命令mysql

grant select,insert,update,delete on *.* to "sys"@"%" identified by "123";

2 mysql 遠端授權

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

flush privileges;

window改mysql資料庫的密碼的命令

set password for 'root'@'localhost' = password('yudun*2017');

以utf8格式匯出資料庫和結構

mysqldump -hlocalhost -p3306 -uroot -pyudun*2017 netgap_conf --default-character-set=utf8 > /opt/systool/conf/netgap_conf_in.sql

資料庫知識點

1.truncate delete和drop delete delete是一行行刪除資料,不影響表結構,並且會記錄日誌,可以進行回滾。truncate 刪除表中所有資料,不記錄日誌,不可以回滾,truncate之後表空間和索引大小會回到初始值。所以truncate之前最好備份 drop 刪除整個表結...

資料庫知識點

資料庫的事務,是指作為單個邏輯工作單元執行的一系列操作。事務處理可以確保除非事務性單元內的所有操作都成功完成,否則不會永久更新面向資料的資源。通過將一組相關操作組合為乙個要麼全部成功要麼全部失敗的單元,可以簡化錯誤恢復並使應用程式更加可靠。乙個邏輯工作單元要成為事務,必須滿足所謂的acid 原子性 ...

資料庫知識點

12頁表必須多看幾遍 長度為 n 個位元組的固定長度且非 unicode 的字元資料。n 必須是乙個介於 1 和 8,000 之間的數值。儲存大小為 n 個位元組。char 在 sql 92 中的同義詞為 character。2 varchar n 長度為 n 個位元組的可變長度且非 unicode...