Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE USER 'user1'@'%' IDENTIFIED BY 'student';
- GRANT USAGE on *.* to 'user2'@'%' IDENTIFIED BY 'student'; ('%') // WSZYSTKIE HOSTY
- grant all privileges on db3.* to user3;
- CREATE USER 'root2'@'%' IDENTIFIED BY 'student';
- grant all privileges on *.* to 'root2' with grant option;
- create database db1;
- create database db2;
- grant all privileges on db1.* to user1;
- grant all privileges on db2.* to user2;
- SET PASSWORD FOR 'user1'@'localhost'=PASSWORD('student2')
- SET PASSWORD FOR 'user2'@'localhost'=PASSWORD('student2')
- revoke all privileges on db3.* from user3;
- use db1;
- create table tabela1(id int auto_increment, Imie varchar(30),Adres varchar(30), Telefon varchar(9), Email varchar(40), primary key(id));
- create table tabela2(id int auto_increment, Imie varchar(30),Adres varchar(30), Telefon varchar(9), Email varchar(40), primary key(id));
- use db2;
- create table tabela3(id int auto_increment, Imie varchar(30),Adres varchar(30), Telefon varchar(9), Email varchar(40), primary key(id));
- create table tabela4(id int auto_increment, Imie varchar(30),Adres varchar(30), Telefon varchar(9), Email varchar(40), primary key(id));
- grant select,insert,update,delete on db2.table3 to user1;
- grant select(imie) on db2.table4 to user1;
- grant all privileges on db1.* to user2;
- show grants;
- show grants for xxx;
- use mysql;
- select * from user;
- select * from db;
- select * from tables_priv;
- select * from columns_priv;
- host
- update user SET Password=PASSWORD('pass') where user='root';
- FLUSH PRIVILEGES; // fizyczne dopisanie
- //Dopisać selecta
Add Comment
Please, Sign In to add comment