How do you refresh the MySQL configuration file without restarting?












27















Apache has such a feature, what about MySQL?



Does one exist?










share|improve this question




















  • 1





    Server Fault has a better answer to the same question: serverfault.com/a/79051

    – Mark Amery
    Jun 8 '14 at 16:36
















27















Apache has such a feature, what about MySQL?



Does one exist?










share|improve this question




















  • 1





    Server Fault has a better answer to the same question: serverfault.com/a/79051

    – Mark Amery
    Jun 8 '14 at 16:36














27












27








27


7






Apache has such a feature, what about MySQL?



Does one exist?










share|improve this question
















Apache has such a feature, what about MySQL?



Does one exist?







mysql database






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 27 '09 at 20:33









Jon

44.6k27114147




44.6k27114147










asked May 27 '09 at 20:29









omgomg

51.4k126253334




51.4k126253334








  • 1





    Server Fault has a better answer to the same question: serverfault.com/a/79051

    – Mark Amery
    Jun 8 '14 at 16:36














  • 1





    Server Fault has a better answer to the same question: serverfault.com/a/79051

    – Mark Amery
    Jun 8 '14 at 16:36








1




1





Server Fault has a better answer to the same question: serverfault.com/a/79051

– Mark Amery
Jun 8 '14 at 16:36





Server Fault has a better answer to the same question: serverfault.com/a/79051

– Mark Amery
Jun 8 '14 at 16:36












4 Answers
4






active

oldest

votes


















24














You were so close! The kill -HUP method wasn't working for me either.



You were calling:



select @@global.max_connections;


All you needed was to set instead of select:



set @@global.max_connections = 400;


See:



http://www.netadmintools.com/art573.html



http://www.electrictoolbox.com/update-max-connections-mysql/






share|improve this answer
























  • that was damn helpful! :)

    – Dennis Winter
    May 29 '12 at 9:02



















17














Try:



sudo /etc/init.d/mysql reload


or



sudo /etc/init.d/mysql force-reload


That should initiate a reload of the configuration. Make sureyour init.d script supports it though, I don't know what version of MySQL/OS you are using?



My MySQL script contains the following:



'reload'|'force-reload')
log_daemon_msg "Reloading MySQL database server" "mysqld"
$MYADMIN reload
log_end_msg 0
;;





share|improve this answer
























  • Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

    – omg
    May 27 '09 at 20:34











  • Oh,looks bad really..

    – omg
    May 27 '09 at 20:35











  • mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

    – Jon
    May 27 '09 at 20:45






  • 1





    none of above works,I've restarted mysql and then it works,thank you anyway!

    – omg
    May 27 '09 at 20:48











  • I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

    – omg
    May 27 '09 at 20:50



















2














Specific actions you can do from SQL client and you don't need to restart anything:



SET GLOBAL log = 'ON';
FLUSH LOGS;





share|improve this answer































    2














    Reloading the configuration file (my.cnf) cannot be done without restarting the mysqld server.



    FLUSH LOGS only rotates a few log files.



    SET @@...=... sets it for anyone not yet logged in, but it will go away after the next restart. But that gives a clue... Do the SET, and change my.cnf; that way you are covered. Caveat: Not all settings can be performed via SET.



    New with MySQL 8.0...



    SET PERSIST ... will set the global setting and save it past restarts. Nearly all settings can be adjusted this way.






    share|improve this answer

























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      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: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2fstackoverflow.com%2fquestions%2f917865%2fhow-do-you-refresh-the-mysql-configuration-file-without-restarting%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      24














      You were so close! The kill -HUP method wasn't working for me either.



      You were calling:



      select @@global.max_connections;


      All you needed was to set instead of select:



      set @@global.max_connections = 400;


      See:



      http://www.netadmintools.com/art573.html



      http://www.electrictoolbox.com/update-max-connections-mysql/






      share|improve this answer
























      • that was damn helpful! :)

        – Dennis Winter
        May 29 '12 at 9:02
















      24














      You were so close! The kill -HUP method wasn't working for me either.



      You were calling:



      select @@global.max_connections;


      All you needed was to set instead of select:



      set @@global.max_connections = 400;


      See:



      http://www.netadmintools.com/art573.html



      http://www.electrictoolbox.com/update-max-connections-mysql/






      share|improve this answer
























      • that was damn helpful! :)

        – Dennis Winter
        May 29 '12 at 9:02














      24












      24








      24







      You were so close! The kill -HUP method wasn't working for me either.



      You were calling:



      select @@global.max_connections;


      All you needed was to set instead of select:



      set @@global.max_connections = 400;


      See:



      http://www.netadmintools.com/art573.html



      http://www.electrictoolbox.com/update-max-connections-mysql/






      share|improve this answer













      You were so close! The kill -HUP method wasn't working for me either.



      You were calling:



      select @@global.max_connections;


      All you needed was to set instead of select:



      set @@global.max_connections = 400;


      See:



      http://www.netadmintools.com/art573.html



      http://www.electrictoolbox.com/update-max-connections-mysql/







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Jul 23 '09 at 19:42









      mixonicmixonic

      2,47011321




      2,47011321













      • that was damn helpful! :)

        – Dennis Winter
        May 29 '12 at 9:02



















      • that was damn helpful! :)

        – Dennis Winter
        May 29 '12 at 9:02

















      that was damn helpful! :)

      – Dennis Winter
      May 29 '12 at 9:02





      that was damn helpful! :)

      – Dennis Winter
      May 29 '12 at 9:02













      17














      Try:



      sudo /etc/init.d/mysql reload


      or



      sudo /etc/init.d/mysql force-reload


      That should initiate a reload of the configuration. Make sureyour init.d script supports it though, I don't know what version of MySQL/OS you are using?



      My MySQL script contains the following:



      'reload'|'force-reload')
      log_daemon_msg "Reloading MySQL database server" "mysqld"
      $MYADMIN reload
      log_end_msg 0
      ;;





      share|improve this answer
























      • Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

        – omg
        May 27 '09 at 20:34











      • Oh,looks bad really..

        – omg
        May 27 '09 at 20:35











      • mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

        – Jon
        May 27 '09 at 20:45






      • 1





        none of above works,I've restarted mysql and then it works,thank you anyway!

        – omg
        May 27 '09 at 20:48











      • I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

        – omg
        May 27 '09 at 20:50
















      17














      Try:



      sudo /etc/init.d/mysql reload


      or



      sudo /etc/init.d/mysql force-reload


      That should initiate a reload of the configuration. Make sureyour init.d script supports it though, I don't know what version of MySQL/OS you are using?



      My MySQL script contains the following:



      'reload'|'force-reload')
      log_daemon_msg "Reloading MySQL database server" "mysqld"
      $MYADMIN reload
      log_end_msg 0
      ;;





      share|improve this answer
























      • Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

        – omg
        May 27 '09 at 20:34











      • Oh,looks bad really..

        – omg
        May 27 '09 at 20:35











      • mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

        – Jon
        May 27 '09 at 20:45






      • 1





        none of above works,I've restarted mysql and then it works,thank you anyway!

        – omg
        May 27 '09 at 20:48











      • I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

        – omg
        May 27 '09 at 20:50














      17












      17








      17







      Try:



      sudo /etc/init.d/mysql reload


      or



      sudo /etc/init.d/mysql force-reload


      That should initiate a reload of the configuration. Make sureyour init.d script supports it though, I don't know what version of MySQL/OS you are using?



      My MySQL script contains the following:



      'reload'|'force-reload')
      log_daemon_msg "Reloading MySQL database server" "mysqld"
      $MYADMIN reload
      log_end_msg 0
      ;;





      share|improve this answer













      Try:



      sudo /etc/init.d/mysql reload


      or



      sudo /etc/init.d/mysql force-reload


      That should initiate a reload of the configuration. Make sureyour init.d script supports it though, I don't know what version of MySQL/OS you are using?



      My MySQL script contains the following:



      'reload'|'force-reload')
      log_daemon_msg "Reloading MySQL database server" "mysqld"
      $MYADMIN reload
      log_end_msg 0
      ;;






      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered May 27 '09 at 20:32









      JonJon

      44.6k27114147




      44.6k27114147













      • Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

        – omg
        May 27 '09 at 20:34











      • Oh,looks bad really..

        – omg
        May 27 '09 at 20:35











      • mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

        – Jon
        May 27 '09 at 20:45






      • 1





        none of above works,I've restarted mysql and then it works,thank you anyway!

        – omg
        May 27 '09 at 20:48











      • I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

        – omg
        May 27 '09 at 20:50



















      • Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

        – omg
        May 27 '09 at 20:34











      • Oh,looks bad really..

        – omg
        May 27 '09 at 20:35











      • mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

        – Jon
        May 27 '09 at 20:45






      • 1





        none of above works,I've restarted mysql and then it works,thank you anyway!

        – omg
        May 27 '09 at 20:48











      • I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

        – omg
        May 27 '09 at 20:50

















      Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

      – omg
      May 27 '09 at 20:34





      Seems not working,I'm using mysql5.1,I added in [mysqld] section:transaction-isolation = READ-UNCOMMITTED,and after running your script, mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+-----------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+-----------------+ | REPEATABLE-READ | REPEATABLE-READ | +-----------------------+-----------------+ 1 row in set (0.00 sec) mysql>

      – omg
      May 27 '09 at 20:34













      Oh,looks bad really..

      – omg
      May 27 '09 at 20:35





      Oh,looks bad really..

      – omg
      May 27 '09 at 20:35













      mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

      – Jon
      May 27 '09 at 20:45





      mysql reload should reload all the grant tables and configuration. What was the outcome of running it?

      – Jon
      May 27 '09 at 20:45




      1




      1





      none of above works,I've restarted mysql and then it works,thank you anyway!

      – omg
      May 27 '09 at 20:48





      none of above works,I've restarted mysql and then it works,thank you anyway!

      – omg
      May 27 '09 at 20:48













      I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

      – omg
      May 27 '09 at 20:50





      I'm changing the configurations of 3 slave databases,after modifying my.cnf,I used your script,but seems not working,only after I restarted 1 of them,I see the output: mysql> SELECT @@GLOBAL.tx_isolation, @@tx_isolation; +-----------------------+------------------+ | @@GLOBAL.tx_isolation | @@tx_isolation | +-----------------------+------------------+ | READ-UNCOMMITTED | READ-UNCOMMITTED | +-----------------------+------------------+ 1 row in set (0.00 sec) say,it changed to READ-UNCOMMITTED,which is what I did in my.cnf

      – omg
      May 27 '09 at 20:50











      2














      Specific actions you can do from SQL client and you don't need to restart anything:



      SET GLOBAL log = 'ON';
      FLUSH LOGS;





      share|improve this answer




























        2














        Specific actions you can do from SQL client and you don't need to restart anything:



        SET GLOBAL log = 'ON';
        FLUSH LOGS;





        share|improve this answer


























          2












          2








          2







          Specific actions you can do from SQL client and you don't need to restart anything:



          SET GLOBAL log = 'ON';
          FLUSH LOGS;





          share|improve this answer













          Specific actions you can do from SQL client and you don't need to restart anything:



          SET GLOBAL log = 'ON';
          FLUSH LOGS;






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 2 '16 at 10:54









          user6007326user6007326

          211




          211























              2














              Reloading the configuration file (my.cnf) cannot be done without restarting the mysqld server.



              FLUSH LOGS only rotates a few log files.



              SET @@...=... sets it for anyone not yet logged in, but it will go away after the next restart. But that gives a clue... Do the SET, and change my.cnf; that way you are covered. Caveat: Not all settings can be performed via SET.



              New with MySQL 8.0...



              SET PERSIST ... will set the global setting and save it past restarts. Nearly all settings can be adjusted this way.






              share|improve this answer






























                2














                Reloading the configuration file (my.cnf) cannot be done without restarting the mysqld server.



                FLUSH LOGS only rotates a few log files.



                SET @@...=... sets it for anyone not yet logged in, but it will go away after the next restart. But that gives a clue... Do the SET, and change my.cnf; that way you are covered. Caveat: Not all settings can be performed via SET.



                New with MySQL 8.0...



                SET PERSIST ... will set the global setting and save it past restarts. Nearly all settings can be adjusted this way.






                share|improve this answer




























                  2












                  2








                  2







                  Reloading the configuration file (my.cnf) cannot be done without restarting the mysqld server.



                  FLUSH LOGS only rotates a few log files.



                  SET @@...=... sets it for anyone not yet logged in, but it will go away after the next restart. But that gives a clue... Do the SET, and change my.cnf; that way you are covered. Caveat: Not all settings can be performed via SET.



                  New with MySQL 8.0...



                  SET PERSIST ... will set the global setting and save it past restarts. Nearly all settings can be adjusted this way.






                  share|improve this answer















                  Reloading the configuration file (my.cnf) cannot be done without restarting the mysqld server.



                  FLUSH LOGS only rotates a few log files.



                  SET @@...=... sets it for anyone not yet logged in, but it will go away after the next restart. But that gives a clue... Do the SET, and change my.cnf; that way you are covered. Caveat: Not all settings can be performed via SET.



                  New with MySQL 8.0...



                  SET PERSIST ... will set the global setting and save it past restarts. Nearly all settings can be adjusted this way.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 15 '18 at 19:44

























                  answered Sep 3 '16 at 18:47









                  Rick JamesRick James

                  70.1k563103




                  70.1k563103






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • 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%2fstackoverflow.com%2fquestions%2f917865%2fhow-do-you-refresh-the-mysql-configuration-file-without-restarting%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

                      Florida Star v. B. J. F.

                      Danny Elfman

                      Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues