How to know if a mysql user has all (or some) privileges on a certain DB?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












How to know if a mysql user has all (or some) privileges on a certain DB?



Of course, I don't ask how to do so with phpmyadmin, rather, with the mysql CLI.



I aim to gather as much as basic data on a certain user but the most important for me is to understand the degree this user is associated with the given database (which has the exact same name as the user name, in this case - both the user and the db, are called test).



Edit for PuzzledCuber:



That's my output for show grants for 'test'@'%';:



+--------------------------------------------------------+
| Grants for test@localhost |
+--------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'localhost' |
| GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost' |
+--------------------------------------------------------+


Why is the second row (GRANT ALL...) different than the first row (GRANT USAGE...)?







share|improve this question


























    up vote
    1
    down vote

    favorite












    How to know if a mysql user has all (or some) privileges on a certain DB?



    Of course, I don't ask how to do so with phpmyadmin, rather, with the mysql CLI.



    I aim to gather as much as basic data on a certain user but the most important for me is to understand the degree this user is associated with the given database (which has the exact same name as the user name, in this case - both the user and the db, are called test).



    Edit for PuzzledCuber:



    That's my output for show grants for 'test'@'%';:



    +--------------------------------------------------------+
    | Grants for test@localhost |
    +--------------------------------------------------------+
    | GRANT USAGE ON *.* TO 'test'@'localhost' |
    | GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost' |
    +--------------------------------------------------------+


    Why is the second row (GRANT ALL...) different than the first row (GRANT USAGE...)?







    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      How to know if a mysql user has all (or some) privileges on a certain DB?



      Of course, I don't ask how to do so with phpmyadmin, rather, with the mysql CLI.



      I aim to gather as much as basic data on a certain user but the most important for me is to understand the degree this user is associated with the given database (which has the exact same name as the user name, in this case - both the user and the db, are called test).



      Edit for PuzzledCuber:



      That's my output for show grants for 'test'@'%';:



      +--------------------------------------------------------+
      | Grants for test@localhost |
      +--------------------------------------------------------+
      | GRANT USAGE ON *.* TO 'test'@'localhost' |
      | GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost' |
      +--------------------------------------------------------+


      Why is the second row (GRANT ALL...) different than the first row (GRANT USAGE...)?







      share|improve this question














      How to know if a mysql user has all (or some) privileges on a certain DB?



      Of course, I don't ask how to do so with phpmyadmin, rather, with the mysql CLI.



      I aim to gather as much as basic data on a certain user but the most important for me is to understand the degree this user is associated with the given database (which has the exact same name as the user name, in this case - both the user and the db, are called test).



      Edit for PuzzledCuber:



      That's my output for show grants for 'test'@'%';:



      +--------------------------------------------------------+
      | Grants for test@localhost |
      +--------------------------------------------------------+
      | GRANT USAGE ON *.* TO 'test'@'localhost' |
      | GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost' |
      +--------------------------------------------------------+


      Why is the second row (GRANT ALL...) different than the first row (GRANT USAGE...)?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 19 '17 at 7:40

























      asked Nov 17 '17 at 18:48









      Arcticooling

      83123




      83123




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          >show grants for 'user'@'%';

          Thie explains how to check users and their privileges:
          http://xmodulo.com/how-to-view-list-of-mysql-users-and-their-privileges.html



          This shows the different permission types and how to grant them:
          https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql



          Hope this helps!






          share|improve this answer




















          • PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
            – Arcticooling
            Nov 19 '17 at 7:41










          • This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
            – PuzzledCuber
            Nov 20 '17 at 0:16











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405322%2fhow-to-know-if-a-mysql-user-has-all-or-some-privileges-on-a-certain-db%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          >show grants for 'user'@'%';

          Thie explains how to check users and their privileges:
          http://xmodulo.com/how-to-view-list-of-mysql-users-and-their-privileges.html



          This shows the different permission types and how to grant them:
          https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql



          Hope this helps!






          share|improve this answer




















          • PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
            – Arcticooling
            Nov 19 '17 at 7:41










          • This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
            – PuzzledCuber
            Nov 20 '17 at 0:16















          up vote
          1
          down vote



          accepted










          >show grants for 'user'@'%';

          Thie explains how to check users and their privileges:
          http://xmodulo.com/how-to-view-list-of-mysql-users-and-their-privileges.html



          This shows the different permission types and how to grant them:
          https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql



          Hope this helps!






          share|improve this answer




















          • PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
            – Arcticooling
            Nov 19 '17 at 7:41










          • This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
            – PuzzledCuber
            Nov 20 '17 at 0:16













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          >show grants for 'user'@'%';

          Thie explains how to check users and their privileges:
          http://xmodulo.com/how-to-view-list-of-mysql-users-and-their-privileges.html



          This shows the different permission types and how to grant them:
          https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql



          Hope this helps!






          share|improve this answer












          >show grants for 'user'@'%';

          Thie explains how to check users and their privileges:
          http://xmodulo.com/how-to-view-list-of-mysql-users-and-their-privileges.html



          This shows the different permission types and how to grant them:
          https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql



          Hope this helps!







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 17 '17 at 19:06









          PuzzledCuber

          938




          938











          • PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
            – Arcticooling
            Nov 19 '17 at 7:41










          • This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
            – PuzzledCuber
            Nov 20 '17 at 0:16

















          • PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
            – Arcticooling
            Nov 19 '17 at 7:41










          • This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
            – PuzzledCuber
            Nov 20 '17 at 0:16
















          PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
          – Arcticooling
          Nov 19 '17 at 7:41




          PuzzeledCuber, deep thanks. Just one more thing, please see my update in the question.
          – Arcticooling
          Nov 19 '17 at 7:41












          This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
          – PuzzledCuber
          Nov 20 '17 at 0:16





          This is because the user existed with no priviledges when you first made it stackoverflow.com/questions/2126225/…
          – PuzzledCuber
          Nov 20 '17 at 0:16


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f405322%2fhow-to-know-if-a-mysql-user-has-all-or-some-privileges-on-a-certain-db%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay