Apply the select privilege to all users in mysql The 2019 Stack Overflow Developer Survey...

Student Loan from years ago pops up and is taking my salary

how can a perfect fourth interval be considered either consonant or dissonant?

How to make Illustrator type tool selection automatically adapt with text length

What was the last x86 CPU that did not have the x87 floating-point unit built in?

Is this wall load bearing? Blueprints and photos attached

Button changing its text & action. Good or terrible?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

Why are PDP-7-style microprogrammed instructions out of vogue?

Does Parliament hold absolute power in the UK?

Sub-subscripts in strings cause different spacings than subscripts

Identify 80s or 90s comics with ripped creatures (not dwarves)

How do spell lists change if the party levels up without taking a long rest?

Voltage transmission

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Make it rain characters

Is there a writing software that you can sort scenes like slides in PowerPoint?

Variable with quotation marks "$()"

Why did Peik Lin say, "I'm not an animal"?

Why can't devices on different VLANs, but on the same subnet, communicate?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Word for: a synonym with a positive connotation?

Circular reasoning in L'Hopital's rule

Drawing vertical/oblique lines in Metrical tree (tikz-qtree, tipa)

Was credit for the black hole image misappropriated?



Apply the select privilege to all users in mysql



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Give privilege to new created databases in MySQLMySQL user without SUPER privilegeHow do I allow remote mysql access to all users?All users are having NO Privileges in phpMyAdminMySQL: What exact commands does each privilege level allow?Export all MySQL usersPrivilege to select only user's own tuple only in mysqlGrant select on all synonyms of schema to another schema in OracleDefault privileges to execute functionWhat are the minimal permissions required for the “Users and Privileges” tab in MySQL Workbench to function in MySQL 5.6





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I have 30 plus MySQL users their permissions vary from one another.



I want to GRANT SELECT privilege to all of the 30 users. Is there any one command that I can use that can grant select to all 30 users in one shot!










share|improve this question
















bumped to the homepage by Community 8 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















    1















    I have 30 plus MySQL users their permissions vary from one another.



    I want to GRANT SELECT privilege to all of the 30 users. Is there any one command that I can use that can grant select to all 30 users in one shot!










    share|improve this question
















    bumped to the homepage by Community 8 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      1












      1








      1








      I have 30 plus MySQL users their permissions vary from one another.



      I want to GRANT SELECT privilege to all of the 30 users. Is there any one command that I can use that can grant select to all 30 users in one shot!










      share|improve this question
















      I have 30 plus MySQL users their permissions vary from one another.



      I want to GRANT SELECT privilege to all of the 30 users. Is there any one command that I can use that can grant select to all 30 users in one shot!







      mysql permissions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 8 '15 at 1:11









      Vérace

      16.4k33550




      16.4k33550










      asked Aug 7 '15 at 20:54









      roger mooreroger moore

      12111




      12111





      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 8 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Try this:



          mysql> select user,host from mysql.user;
          +------------------+-----------+
          | user | host |
          +------------------+-----------+
          | debian-sys-maint | localhost |
          | eroom | localhost |
          | musr | localhost |
          | musr | localhost |
          +------------------+-----------+
          4 rows in set (0.00 sec)

          mysql> select concat('GRANT SELECT ON *.* to "',user,'"@"',host,'";') into outfile '/tmp/select_script.sql' FROM mysql.user;
          Query OK, 4 rows affected (0.00 sec)

          mysql> source /tmp/select_script.sql;
          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)





          share|improve this answer





















          • 1





            Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

            – Vérace
            Aug 8 '15 at 1:13











          • Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

            – eroomydna
            Aug 8 '15 at 7:07












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f109432%2fapply-the-select-privilege-to-all-users-in-mysql%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          Try this:



          mysql> select user,host from mysql.user;
          +------------------+-----------+
          | user | host |
          +------------------+-----------+
          | debian-sys-maint | localhost |
          | eroom | localhost |
          | musr | localhost |
          | musr | localhost |
          +------------------+-----------+
          4 rows in set (0.00 sec)

          mysql> select concat('GRANT SELECT ON *.* to "',user,'"@"',host,'";') into outfile '/tmp/select_script.sql' FROM mysql.user;
          Query OK, 4 rows affected (0.00 sec)

          mysql> source /tmp/select_script.sql;
          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)





          share|improve this answer





















          • 1





            Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

            – Vérace
            Aug 8 '15 at 1:13











          • Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

            – eroomydna
            Aug 8 '15 at 7:07
















          0














          Try this:



          mysql> select user,host from mysql.user;
          +------------------+-----------+
          | user | host |
          +------------------+-----------+
          | debian-sys-maint | localhost |
          | eroom | localhost |
          | musr | localhost |
          | musr | localhost |
          +------------------+-----------+
          4 rows in set (0.00 sec)

          mysql> select concat('GRANT SELECT ON *.* to "',user,'"@"',host,'";') into outfile '/tmp/select_script.sql' FROM mysql.user;
          Query OK, 4 rows affected (0.00 sec)

          mysql> source /tmp/select_script.sql;
          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)





          share|improve this answer





















          • 1





            Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

            – Vérace
            Aug 8 '15 at 1:13











          • Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

            – eroomydna
            Aug 8 '15 at 7:07














          0












          0








          0







          Try this:



          mysql> select user,host from mysql.user;
          +------------------+-----------+
          | user | host |
          +------------------+-----------+
          | debian-sys-maint | localhost |
          | eroom | localhost |
          | musr | localhost |
          | musr | localhost |
          +------------------+-----------+
          4 rows in set (0.00 sec)

          mysql> select concat('GRANT SELECT ON *.* to "',user,'"@"',host,'";') into outfile '/tmp/select_script.sql' FROM mysql.user;
          Query OK, 4 rows affected (0.00 sec)

          mysql> source /tmp/select_script.sql;
          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)





          share|improve this answer















          Try this:



          mysql> select user,host from mysql.user;
          +------------------+-----------+
          | user | host |
          +------------------+-----------+
          | debian-sys-maint | localhost |
          | eroom | localhost |
          | musr | localhost |
          | musr | localhost |
          +------------------+-----------+
          4 rows in set (0.00 sec)

          mysql> select concat('GRANT SELECT ON *.* to "',user,'"@"',host,'";') into outfile '/tmp/select_script.sql' FROM mysql.user;
          Query OK, 4 rows affected (0.00 sec)

          mysql> source /tmp/select_script.sql;
          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)

          Query OK, 0 rows affected (0.00 sec)






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 8 '15 at 1:01









          oNare

          2,69921231




          2,69921231










          answered Aug 7 '15 at 21:11









          eroomydnaeroomydna

          84645




          84645








          • 1





            Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

            – Vérace
            Aug 8 '15 at 1:13











          • Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

            – eroomydna
            Aug 8 '15 at 7:07














          • 1





            Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

            – Vérace
            Aug 8 '15 at 1:13











          • Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

            – eroomydna
            Aug 8 '15 at 7:07








          1




          1





          Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

          – Vérace
          Aug 8 '15 at 1:13





          Would something like 'GRANT SELECT ON *.My_Database...." be better - i.e. specify the database, rather than granting SELECT on everything?

          – Vérace
          Aug 8 '15 at 1:13













          Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

          – eroomydna
          Aug 8 '15 at 7:07





          Always. Only providing the minimal and most granular is erring on the side of caution and security best practice.

          – eroomydna
          Aug 8 '15 at 7:07


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f109432%2fapply-the-select-privilege-to-all-users-in-mysql%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Parapolítica Índice Antecedentes El escándalo Proceso judicial Consecuencias Véase...

          How to remove border from elements in the last row?Targeting flex items on the last rowHow to vertically wrap...

          Tecnologías entrañables Índice Antecedentes Desarrollo Tecnologías Entrañables en la...