Sunum yükleniyor. Lütfen bekleyiniz

Sunum yükleniyor. Lütfen bekleyiniz

VTYS 2012 Mehmet Emin KORKUSUZ Ders - 06. DATA CONTROL LANGUAGE DCL.

Benzer bir sunumlar


... konulu sunumlar: "VTYS 2012 Mehmet Emin KORKUSUZ Ders - 06. DATA CONTROL LANGUAGE DCL."— Sunum transkripti:

1 VTYS 2012 Mehmet Emin KORKUSUZ Ders - 06

2 DATA CONTROL LANGUAGE DCL

3 CREATE USER user_specification [, user_specification]... user_specification: user [IDENTIFIED BY [PASSWORD] 'password' | IDENTIFIED WITH auth_plugin [AS 'auth_string'] ] CREATE USER

4  CREATE USER IDENTIFIED BY ‘sifre';  CREATE USER IDENTIFIED ‘zorsifre’;  CREATE USER IDENTIFIED ‘sifre’;  INSERT INTO user (host,user,password) VALUES('localhost',‘kullanici',PASSWORD(‘sifre’)); CREATE USER

5  DROP USER DROP USER

6  RENAME USER TO RENAME USER

7  SET PASSWORD FOR = PASSWORD(‘sifre');  UPDATE mysql.user SET Password=PASSWORD(‘sifre') WHERE User=‘can' AND Host='%.edu.tr';  FLUSH PRIVILEGES;  GRANT USAGE ON *.* TO IDENTIFIED BY ‘sifre'; SET PASSWORD

8 YETKİLENDİRME Grant Revoke Kullanıcıya yetki vermek. kullanıcıyı yetkilendirmek Kullanıcının yetkilerini kaldırmak

9 GRANT priv_type [(column_list)] [, priv_type [(column_list)]]... ON [object_type] priv_level TO user_specification [, user_specification]... [REQUIRE {NONE | ssl_option [[AND] ssl_option]...}] [WITH with_option...]

10  GRANT PROXY ON user_specification TO user_specification [, user_specification]... [WITH GRANT OPTION]

11 object_type: TABLE | FUNCTION | PROCEDURE priv_level: * | *.* | db_name.* | db_name.tbl_name | tbl_name | db_name.routine_name

12 with_option: GRANT OPTION | MAX_QUERIES_PER_HOUR count | MAX_UPDATES_PER_HOUR count | MAX_CONNECTIONS_PER_HOUR count | MAX_USER_CONNECTIONS count

13 Drop Select İnsert Delete Create Verilebilecek Yetkiler Update GRANT ALL USAGE

14 Genel Kullanımı GRANT YETKILER ON VERITABANI_ADI TO KULLANICI IDENTIFIED BY Istenen_Sifre ; GRANT grant allon *to dilekidentified by 'sifrem' with grant option;

15 Örnek: Birden çok kullanıcıya hem veri tabanı hem de tablo oluşturma izni vermek istersek; GRANT GRANT CREATE DATABASE, CREATE TABLE TO kul1,kul2;

16 Eğer hosttan iletişimi kontrol etmek istiyorsak; GRANT YETKILER ON VERITABANI_ADI TO Adı/ID Numarası’ IDENTIFIED BY Istenen_Sifre ; Örneğin; grant all on * to identified by 'bote'; GRANT

17 GRANT CREATE DATABASE ON deneme.* TO IDENTIFIED BY 'sifre1'; Örnek: dilek kullanicisina deneme veritabani uzerinde sifre1 parolasi ile ip_adresli makineden veritabanı oluşturma izni ile baglanabilmesi icin; GRANT

18  CREATE USER IDENTIFIED BY ‘sifre';  GRANT ALL ON db1.* TO  GRANT SELECT ON db2.ogrenci TO  GRANT USAGE ON *.* WITH MAX_QUERIES_PER_HOUR 90; GRANT

19  GRANT ALL ON *.* TO  GRANT SELECT, INSERT ON *.* TO  GRANT ALL ON mydb.* TO  GRANT SELECT, INSERT ON mydb.* TO GRANT

20  GRANT ALL ON mydb.mytbl TO  GRANT SELECT, INSERT ON mydb.mytbl TO  GRANT SELECT (col1), INSERT (col1,col2) ON mydb.mytbl TO  GRANT CREATE ROUTINE ON mydb.* TO  GRANT EXECUTE ON PROCEDURE mydb.myproc TO GRANT

21  GRANT ALL PRIVILEGES ON test.* TO IDENTIFIED BY 'goodsecret' REQUIRE SSL; GRANT SSL

22  REVOKE priv_type [(column_list)] [, priv_type [(column_list)]]... ON [object_type] priv_level FROM user [, user]...  REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user]...  REVOKE PROXY ON user FROM user [, user] … REVOKE

23  REVOKE INSERT ON *.* FROM  REVOKE ALL PRIVILEGES, GRANT OPTION FROM user [, user]... REVOKE

24 SELECT

25  Tekrarlı sonuçları eler. Group by gibi çalışır. DISTINCT

26  Sonuçları sıralamak için kullanılır.  ASC artan sıralama  DESC azalan sıralama  SELECT college, region, seed FROM tournament ORDER BY region, seed; ORDER BY

27  Sorguya şart ekler.  Select * from ogrenci where yas<20;  Select * from ogrenci where yas 150;  Select * from ogrenci where yas 150 or isim like ‘a%’; WHERE

28  SELECT t1.name, t2.salary FROM employee AS t1, info AS t2 WHERE t1.name = t2.name;  SELECT t1.name, t2.salary FROM employee t1, info t2 WHERE t1.name = t2.name; WHERE

29  Bir alanın değeri bir küme içinden herhangi bir değere eşitse sonucu gösterir.  SELECT * FROM adres WHERE ülkekod IN (‘TR’,‘US’,‘UK’,‘GB’,‘CN’) IN

30  İki değer arasını göstermenin kısa yoludur.  SELECT * FROM ogrenci WHERE vize>= 90 AND vize<= 100;  SELECT * FROM ogrenci WHERE vize BETWEEN 90 AND 100; BETWEEN … AND …

31  %  _  [harf]  [^harf]  [A-Z] LIKE

32  SELECT * FROM `haber` WHERE baslik like '%arama%';  SELECT * FROM `haber` WHERE baslik like 'a%'; LIKE

33  SELECT * FROM maas WHERE kst LIKE '%1740 %' OR kst LIKE '%1938 %' OR kst LIKE '%1940 %‘;  SELECT * from maas where kst REGEXP '1740|1938|1940'; LIKE

34  Tip dönüşümü yapmak için kullanılır.  SELECT CONVERT('abc' USING utf8);  SELECT 'A' LIKE CONVERT(blob_col USING latin1) FROM tbl_name;  = BINARY 'New York';  SELECT USING latin1)); CAST | CONVERT

35  SELECT CAST(1-2 AS UNSIGNED) ;  SELECT CAST(CAST(1-2 AS UNSIGNED) AS SIGNED);


"VTYS 2012 Mehmet Emin KORKUSUZ Ders - 06. DATA CONTROL LANGUAGE DCL." indir ppt

Benzer bir sunumlar


Google Reklamları