MySQL資料庫函式 DCL詳解(及備份恢復操作)

2022-06-06 23:48:12 字數 1147 閱讀 2262

md5(str)

count()

min()

max()

sum()

ads(num)

mod(num1, num2)

ceiling(num)

floor(num)

round(num)

round(num, n)

least(num, num2 ....)

length(str)

instr(str, substr)

insert(str1, index, len, str2)

replace(str, oldstr, newstr)

left(str, len) / right(str, len)

curdate() / current_date();

curtime() / current_time();

year(date)

ifnull(v1, v2)

nullif(expr1, expr2)

新建資料庫testdb create datebase testdb;

新建使用者 laowang 並賦予 testdb資料庫相應的許可權 grant all privileges on testdb.* to laowang@localhost identified by '123';

如果想指定部分的許可權給使用者 grant select, update on testdb.* to laowang@localhost identified by '123';

賦予使用者 laowang 所有資料庫的某些許可權 grant select, update, insert, create, drop on . to laowang@"%" identified by '123';

注意:all privileges, ., "%"(所有的登陸主機)

常用的許可權 select 對所有表進行查詢操作 insert 對所有表進行插入操作 update 對所有表進行更新操作 delete 對所有表進行刪除操作 create 資料庫、表、索引 drop 資料庫和表的刪除操作 alter 對所有表進行更改

檢視索引

刪除索引

唯一索引

主鍵索引

例如;注意

myisam

showtooltip

MySQL資料庫函式詳解

1 int mysql affected rows int link id 在給定的連線中,返回由最近的delete insert replace或者update語句所作用的行數。如果沒有行 被修改,則mysql affected rows 返回0,如果出現錯誤,則返回 1。在select查詢之後,...

MySQL資料庫函式詳解 2

由select查詢返回的每個結果集都有乙個行游標,指示下乙個提取行的函式 mysql fetch array mysql fetch object 或者mysql fetch row 呼叫將返回哪一行。mysql data seek 將給定結果集的指標設定到給定的行。行號的範圍為0到mysql nu...

資料庫函式

常用函式 dual是乙個oracle內部表,不論我們做什麼操作 不要刪除記錄 可以做很多取系統時間,計算等。虛表 dual 是oracle提供的最小的工作表,它僅包含一行一列。select from dual abs 絕對值 select abs 10 abs 10 from dual 10 10 ...