system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/exec.sh -n dnode1 -s start sql connect print =============== create db sql create database d1 vgroups 1; sql create database d2 vgroups 1; sql create database d3 vgroups 1; sql select * from information_schema.ins_databases if $rows != 5 then return -1 endi print =============== create users sql create user user1 PASS 'user1' sql create user user2 PASS 'user2' sql select * from information_schema.ins_users if $rows != 3 then return -1 endi print =============== test read sql_error GRANT read ON d1.* to a; sql_error GRANT read ON d0.* to user1; sql GRANT read ON d1.* to user1; sql GRANT read ON d2.* to user1; sql GRANT read ON *.* to user1; sql REVOKE read ON d1.* from user1; sql REVOKE read ON d2.* from user1; sql REVOKE read ON *.* from user1; print =============== test write sql_error GRANT write ON d1.* to a; sql_error GRANT write ON d0.* to user1; sql GRANT write ON d1.* to user1; sql GRANT write ON d2.* to user1; sql GRANT write ON *.* to user1; sql REVOKE write ON d1.* from user1; sql REVOKE write ON d2.* from user1; sql REVOKE write ON *.* from user1; print =============== test all sql_error GRANT all ON d1.* to a; sql_error GRANT all ON d0.* to user1; sql GRANT all ON d1.* to user1; sql GRANT all ON d2.* to user1; sql GRANT all ON *.* to user1; sql REVOKE all ON d1.* from user1; sql REVOKE all ON d2.* from user1; sql REVOKE all ON *.* from user1; print =============== test read write sql_error GRANT read,write ON d1.* to a; sql_error GRANT read,write ON d0.* to user1; sql GRANT read,write ON d1.* to user1; sql GRANT read,write ON d2.* to user1; sql GRANT read,write ON *.* to user1; sql REVOKE read,write ON d1.* from user1; sql REVOKE read,write ON d2.* from user1; sql REVOKE read,write ON *.* from user1; print =============== create users sql create user u1 PASS 'taosdata' sql select * from information_schema.ins_users if $rows != 4 then return -1 endi sql GRANT read ON d1.* to u1; sql GRANT write ON d2.* to u1; print =============== re connect print user u1 login sql close sql connect u1 sql_error drop database d1; sql_error drop database d2; sql_error create stable d1.st (ts timestamp, i int) tags (j int) sql create stable d2.st (ts timestamp, i int) tags (j int) system sh/exec.sh -n dnode1 -s stop -x SIGINT