28 lines
1.2 KiB
Plaintext
28 lines
1.2 KiB
Plaintext
create database db1;
|
|
set @orig_sql_mode= @@sql_mode;
|
|
set sql_mode= (select replace(@@sql_mode,'NO_AUTO_CREATE_USER',''));
|
|
Warnings:
|
|
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
|
|
GRANT CREATE ON db1.* to user_1@localhost;
|
|
Warnings:
|
|
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
|
GRANT SELECT ON db1.* to USER_1@localhost;
|
|
Warnings:
|
|
Warning 1287 Using GRANT for creating new user is deprecated and will be removed in future release. Create new user with CREATE USER statement.
|
|
set sql_mode= @orig_sql_mode;
|
|
Warnings:
|
|
Warning 3090 Changing sql mode 'NO_AUTO_CREATE_USER' is deprecated. It will be removed in a future release.
|
|
CREATE TABLE t1(f1 int);
|
|
SELECT * FROM t1;
|
|
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
|
|
SELECT * FROM t1;
|
|
f1
|
|
CREATE TABLE t2(f1 int);
|
|
ERROR 42000: CREATE command denied to user 'USER_1'@'localhost' for table 't2'
|
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
|
|
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
|
|
DROP USER user_1@localhost;
|
|
DROP USER USER_1@localhost;
|
|
DROP DATABASE db1;
|
|
use test;
|