programming-examples/sql/UserManagement/3. How to grant permission to a user to select only from localhost.sql

13 lines
386 B
MySQL
Raw Normal View History

2019-11-18 14:05:53 +01:00
/*3. How to grant permission to a user to select only from localhost.
*/
/*Syntax :
grant [<permission_1,permission_2,...permission_n>|<all>]
on [database].[<table_name>|<all_tables(*)>]
to [user name]@[<localhost>|<IP address>|<any host('%')>]
identified by ["password"];
*/
grant select on posts.* to ramaswamy@localhost identified by 'mypassword';
flush privileges;