{"id":2261,"date":"2013-07-12T15:24:57","date_gmt":"2013-07-12T07:24:57","guid":{"rendered":"http:\/\/rmohan.com\/?p=2261"},"modified":"2013-07-12T15:25:09","modified_gmt":"2013-07-12T07:25:09","slug":"mysql-grant","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2261","title":{"rendered":"Mysql grant"},"content":{"rendered":"<p>&nbsp;<\/p>\n<div>Some mysql grant queries<\/div>\n<div><\/div>\n<div><\/div>\n<div>Granting permission for a particular\u00a0 DB only<\/div>\n<div>mysql&gt; grant all privileges on databasename.* to &#8216;username&#8217;@&#8217;localhost&#8217;;<\/div>\n<div>mysql&gt; flush privileges;<\/div>\n<p>&nbsp;<\/p>\n<div>Granting Permission for all the DB<b><\/b><\/div>\n<div>mysql&gt; grant all privileges on *.* to &#8216;username&#8217;@&#8217;localhost&#8217;;<\/div>\n<p>&nbsp;<\/p>\n<div>Granting Permission from a particular IP<b><\/b><\/div>\n<div># grant all privileges on *.* to &#8216;username&#8217;@&#8217;192.168.0.20&#8217;;<\/div>\n<p>&nbsp;<\/p>\n<div>\u00a0# grant usage on *.* to bob@localhost identified by &#8216;passwd&#8217;;<\/div>\n<div># SHOW GRANTS FOR &#8216;admin&#8217;@&#8217;localhost&#8217;;<\/div>\n<p>Granting selected privilages for user\u00a0<b><br \/>\n<\/b><\/p>\n<div># grant select,insert,update,delete,create,drop on TestDb.* to &#8216;ctechz&#8217;@&#8217;localhost&#8217; identified by &#8216;ctechz&#8217;;<\/div>\n<p>&nbsp;<\/p>\n<div>\u00a0After creating the user give permission to him using grant<\/div>\n<div># create user username identified by &#8216;password&#8217;;<\/div>\n<div># GRANT ALL PRIVILEGES ON *.* TO &#8216;monty&#8217;@&#8217;%&#8217; WITH GRANT OPTION;<\/div>\n<p>&#8212; % means from all host.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;<\/p>\n<p> Some mysql grant queries Granting permission for a particular DB only mysql&gt; grant all privileges on databasename.* to &#8216;username&#8217;@&#8217;localhost&#8217;; mysql&gt; flush privileges; <\/p>\n<p>&nbsp;<\/p>\n<p> Granting Permission for all the DB mysql&gt; grant all privileges on *.* to &#8216;username&#8217;@&#8217;localhost&#8217;; <\/p>\n<p>&nbsp;<\/p>\n<p> Granting Permission from a particular IP # grant all privileges on *.* to &#8216;username&#8217;@&#8217;192.168.0.20&#8217;; <\/p>\n<p>&nbsp;<\/p>\n<p> # [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2261"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2261"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2261\/revisions"}],"predecessor-version":[{"id":2263,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2261\/revisions\/2263"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}