“/private/etc/my.cnf” E212: Can't open file for writing











up vote
0
down vote

favorite












I want to add the socket=/tmp/mysql.sock to my.cnf file:
My steps:



1)



vi /etc/my.cnf


2)add this line in the my.cnf:



socket=/tmp/mysql.sock


3) but when I use :wq to quit:



I get this issue:




"/private/etc/my.cnf" E212: Can't open file for writing






enter image description here



Then I press enter it will go back to the my.cnf's content.





Additional -1



$ id 



aircraftdeMacBook-Pro:~ ldl$ id
uid=501(ldl) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),702(com.apple.sharepoint.group.2)




Additional -2



$ ls -l /private/etc/my.cnf



ls: /private/etc/my.cnf: No such file or directory






Additional -3



In my mysql/support-files












share|improve this question




























    up vote
    0
    down vote

    favorite












    I want to add the socket=/tmp/mysql.sock to my.cnf file:
    My steps:



    1)



    vi /etc/my.cnf


    2)add this line in the my.cnf:



    socket=/tmp/mysql.sock


    3) but when I use :wq to quit:



    I get this issue:




    "/private/etc/my.cnf" E212: Can't open file for writing






    enter image description here



    Then I press enter it will go back to the my.cnf's content.





    Additional -1



    $ id 



    aircraftdeMacBook-Pro:~ ldl$ id
    uid=501(ldl) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),702(com.apple.sharepoint.group.2)




    Additional -2



    $ ls -l /private/etc/my.cnf



    ls: /private/etc/my.cnf: No such file or directory






    Additional -3



    In my mysql/support-files












    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I want to add the socket=/tmp/mysql.sock to my.cnf file:
      My steps:



      1)



      vi /etc/my.cnf


      2)add this line in the my.cnf:



      socket=/tmp/mysql.sock


      3) but when I use :wq to quit:



      I get this issue:




      "/private/etc/my.cnf" E212: Can't open file for writing






      enter image description here



      Then I press enter it will go back to the my.cnf's content.





      Additional -1



      $ id 



      aircraftdeMacBook-Pro:~ ldl$ id
      uid=501(ldl) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),702(com.apple.sharepoint.group.2)




      Additional -2



      $ ls -l /private/etc/my.cnf



      ls: /private/etc/my.cnf: No such file or directory






      Additional -3



      In my mysql/support-files












      share|improve this question















      I want to add the socket=/tmp/mysql.sock to my.cnf file:
      My steps:



      1)



      vi /etc/my.cnf


      2)add this line in the my.cnf:



      socket=/tmp/mysql.sock


      3) but when I use :wq to quit:



      I get this issue:




      "/private/etc/my.cnf" E212: Can't open file for writing






      enter image description here



      Then I press enter it will go back to the my.cnf's content.





      Additional -1



      $ id 



      aircraftdeMacBook-Pro:~ ldl$ id
      uid=501(ldl) gid=20(staff) groups=20(staff),701(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),702(com.apple.sharepoint.group.2)




      Additional -2



      $ ls -l /private/etc/my.cnf



      ls: /private/etc/my.cnf: No such file or directory






      Additional -3



      In my mysql/support-files









      permissions osx configuration






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 at 14:06









      Kusalananda

      118k16223364




      118k16223364










      asked Feb 9 '17 at 9:24









      aircraft

      18512




      18512






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          You obviously don't have write access to mentioned file. To check it do:



          ls -l /private/etc/my.cnf


          To get know which user you are using use id command. You should either be an owner of the file or belong to the group that has write access (w letter in ls output) to this file.



          Of course, you should be able to escalate your privileges to write this file. Use sudo or log in as a root.



          Edit1:



          Och, so you are using OSX :)
          According to MySQL settings on OSX you need to create /etc/my.cnf file. You will have to use sudo to do that. So sudo vi /etc/my.cnf.
          Note, that if this file is not present, then it would be wise to copy example configuration file as mentioned in above link and then edit it:



          sudo cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf
          sudo vi /etc/my.cnf


          Sudo will ask for your administrator password (at least according to online help). This account needs to have password set.



          Edit2:



          File my-default.cnf looks good. Copy it to /etc/my.cnf and start editing.



          sudo cp my-default.cnf /etc/my.cnf





          share|improve this answer























          • I have add more information to my post, have a look.
            – aircraft
            Feb 9 '17 at 10:48










          • @aircraft, answer updated.
            – Kalavan
            Feb 9 '17 at 11:31












          • but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
            – aircraft
            Feb 9 '17 at 11:38










          • @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
            – Kalavan
            Feb 9 '17 at 14:13












          • see my ` Addtional -3`
            – aircraft
            Feb 9 '17 at 14:40











          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: 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%2funix.stackexchange.com%2fquestions%2f343674%2fprivate-etc-my-cnf-e212-cant-open-file-for-writing%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








          up vote
          0
          down vote













          You obviously don't have write access to mentioned file. To check it do:



          ls -l /private/etc/my.cnf


          To get know which user you are using use id command. You should either be an owner of the file or belong to the group that has write access (w letter in ls output) to this file.



          Of course, you should be able to escalate your privileges to write this file. Use sudo or log in as a root.



          Edit1:



          Och, so you are using OSX :)
          According to MySQL settings on OSX you need to create /etc/my.cnf file. You will have to use sudo to do that. So sudo vi /etc/my.cnf.
          Note, that if this file is not present, then it would be wise to copy example configuration file as mentioned in above link and then edit it:



          sudo cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf
          sudo vi /etc/my.cnf


          Sudo will ask for your administrator password (at least according to online help). This account needs to have password set.



          Edit2:



          File my-default.cnf looks good. Copy it to /etc/my.cnf and start editing.



          sudo cp my-default.cnf /etc/my.cnf





          share|improve this answer























          • I have add more information to my post, have a look.
            – aircraft
            Feb 9 '17 at 10:48










          • @aircraft, answer updated.
            – Kalavan
            Feb 9 '17 at 11:31












          • but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
            – aircraft
            Feb 9 '17 at 11:38










          • @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
            – Kalavan
            Feb 9 '17 at 14:13












          • see my ` Addtional -3`
            – aircraft
            Feb 9 '17 at 14:40















          up vote
          0
          down vote













          You obviously don't have write access to mentioned file. To check it do:



          ls -l /private/etc/my.cnf


          To get know which user you are using use id command. You should either be an owner of the file or belong to the group that has write access (w letter in ls output) to this file.



          Of course, you should be able to escalate your privileges to write this file. Use sudo or log in as a root.



          Edit1:



          Och, so you are using OSX :)
          According to MySQL settings on OSX you need to create /etc/my.cnf file. You will have to use sudo to do that. So sudo vi /etc/my.cnf.
          Note, that if this file is not present, then it would be wise to copy example configuration file as mentioned in above link and then edit it:



          sudo cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf
          sudo vi /etc/my.cnf


          Sudo will ask for your administrator password (at least according to online help). This account needs to have password set.



          Edit2:



          File my-default.cnf looks good. Copy it to /etc/my.cnf and start editing.



          sudo cp my-default.cnf /etc/my.cnf





          share|improve this answer























          • I have add more information to my post, have a look.
            – aircraft
            Feb 9 '17 at 10:48










          • @aircraft, answer updated.
            – Kalavan
            Feb 9 '17 at 11:31












          • but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
            – aircraft
            Feb 9 '17 at 11:38










          • @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
            – Kalavan
            Feb 9 '17 at 14:13












          • see my ` Addtional -3`
            – aircraft
            Feb 9 '17 at 14:40













          up vote
          0
          down vote










          up vote
          0
          down vote









          You obviously don't have write access to mentioned file. To check it do:



          ls -l /private/etc/my.cnf


          To get know which user you are using use id command. You should either be an owner of the file or belong to the group that has write access (w letter in ls output) to this file.



          Of course, you should be able to escalate your privileges to write this file. Use sudo or log in as a root.



          Edit1:



          Och, so you are using OSX :)
          According to MySQL settings on OSX you need to create /etc/my.cnf file. You will have to use sudo to do that. So sudo vi /etc/my.cnf.
          Note, that if this file is not present, then it would be wise to copy example configuration file as mentioned in above link and then edit it:



          sudo cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf
          sudo vi /etc/my.cnf


          Sudo will ask for your administrator password (at least according to online help). This account needs to have password set.



          Edit2:



          File my-default.cnf looks good. Copy it to /etc/my.cnf and start editing.



          sudo cp my-default.cnf /etc/my.cnf





          share|improve this answer














          You obviously don't have write access to mentioned file. To check it do:



          ls -l /private/etc/my.cnf


          To get know which user you are using use id command. You should either be an owner of the file or belong to the group that has write access (w letter in ls output) to this file.



          Of course, you should be able to escalate your privileges to write this file. Use sudo or log in as a root.



          Edit1:



          Och, so you are using OSX :)
          According to MySQL settings on OSX you need to create /etc/my.cnf file. You will have to use sudo to do that. So sudo vi /etc/my.cnf.
          Note, that if this file is not present, then it would be wise to copy example configuration file as mentioned in above link and then edit it:



          sudo cp /usr/local/mysql/support-files/my-huge.cnf /etc/my.cnf
          sudo vi /etc/my.cnf


          Sudo will ask for your administrator password (at least according to online help). This account needs to have password set.



          Edit2:



          File my-default.cnf looks good. Copy it to /etc/my.cnf and start editing.



          sudo cp my-default.cnf /etc/my.cnf






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 9 '17 at 16:01

























          answered Feb 9 '17 at 10:39









          Kalavan

          54629




          54629












          • I have add more information to my post, have a look.
            – aircraft
            Feb 9 '17 at 10:48










          • @aircraft, answer updated.
            – Kalavan
            Feb 9 '17 at 11:31












          • but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
            – aircraft
            Feb 9 '17 at 11:38










          • @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
            – Kalavan
            Feb 9 '17 at 14:13












          • see my ` Addtional -3`
            – aircraft
            Feb 9 '17 at 14:40


















          • I have add more information to my post, have a look.
            – aircraft
            Feb 9 '17 at 10:48










          • @aircraft, answer updated.
            – Kalavan
            Feb 9 '17 at 11:31












          • but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
            – aircraft
            Feb 9 '17 at 11:38










          • @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
            – Kalavan
            Feb 9 '17 at 14:13












          • see my ` Addtional -3`
            – aircraft
            Feb 9 '17 at 14:40
















          I have add more information to my post, have a look.
          – aircraft
          Feb 9 '17 at 10:48




          I have add more information to my post, have a look.
          – aircraft
          Feb 9 '17 at 10:48












          @aircraft, answer updated.
          – Kalavan
          Feb 9 '17 at 11:31






          @aircraft, answer updated.
          – Kalavan
          Feb 9 '17 at 11:31














          but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
          – aircraft
          Feb 9 '17 at 11:38




          but when I execute copy, issue: cp: /usr/local/mysql/support-files/my-huge.cnf: No such file or directory
          – aircraft
          Feb 9 '17 at 11:38












          @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
          – Kalavan
          Feb 9 '17 at 14:13






          @Aircraft, Did you check directory? You can do it with ls command. Do you have MySQL installed?
          – Kalavan
          Feb 9 '17 at 14:13














          see my ` Addtional -3`
          – aircraft
          Feb 9 '17 at 14:40




          see my ` Addtional -3`
          – aircraft
          Feb 9 '17 at 14:40


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux 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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2funix.stackexchange.com%2fquestions%2f343674%2fprivate-etc-my-cnf-e212-cant-open-file-for-writing%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

          Scott Moir

          Souastre

          Morgemoulin