Advertisement
Guest User

Untitled

a guest
Nov 6th, 2015
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. create database bank;
  2. Untuk membuat database bank
  3.  
  4. use bank;
  5.  
  6.  
  7. create table bank(no_pegawai int(10), nama varchar(30), cabang varchar(30));
  8. create table pegawai(no_pegawai int(10), nama_pegawai varchar(30), email varchar(30));
  9.  
  10. insert into bank values
  11. ('man’,'Mandiri','Beji),
  12. ('bca','BCA','Sukmajaya'),
  13. ('bri','BRI','Lenteng Agung'),
  14. ('bni','BNI','Kemang'),
  15. ('bri','BRI','Sudirman');
  16.  
  17. insert into pegawai values
  18. ('man','Ramadhani','ramadhani.26@gmail.com'),
  19. ('bri','Fitrah','fitrah.26@gmail.com'),
  20. ('bca','Tarzky','tarzky.26@gmail.com'),
  21. ('bri','Punky','punku.26@gmail.com'),
  22. ('man','Brandy','brandy.26@gmail.com');
  23.  
  24. create user fitrah@localhost;
  25. create user ramadhan@localhost;
  26.  
  27. use mysql;
  28. select user, password from user;
  29. grant select ON coba .* TO fitrah;
  30. exit;
  31.  
  32. mysql -u root
  33. use mysql;
  34. grant all privileges ON *.* TO fitrah@localhost with grant option;
  35.  
  36. use mysql;
  37. update user set password= PASSWORD ('123') where user='fitrah' and host='localhost';
  38. set password for fitrah@localhost=password('123');
  39. exit;
  40.  
  41. mysql -u fitrah-p;
  42. show databases;
  43. drop database bank;
  44. exit;
  45.  
  46. mysql -u root;
  47. set password for fitrah@localhost=password('123');
  48. exit;
  49.  
  50. mysql -u fitrah -p
  51. drop database lat;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement