“/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
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
add a comment |
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
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
add a comment |
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
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
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
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
permissions osx configuration
edited Nov 26 at 14:06


Kusalananda
118k16223364
118k16223364
asked Feb 9 '17 at 9:24


aircraft
18512
18512
add a comment |
add a comment |
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
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 withls
command. Do you have MySQL installed?
– Kalavan
Feb 9 '17 at 14:13
see my ` Addtional -3`
– aircraft
Feb 9 '17 at 14:40
add a comment |
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
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 withls
command. Do you have MySQL installed?
– Kalavan
Feb 9 '17 at 14:13
see my ` Addtional -3`
– aircraft
Feb 9 '17 at 14:40
add a comment |
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
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 withls
command. Do you have MySQL installed?
– Kalavan
Feb 9 '17 at 14:13
see my ` Addtional -3`
– aircraft
Feb 9 '17 at 14:40
add a comment |
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
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
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 withls
command. Do you have MySQL installed?
– Kalavan
Feb 9 '17 at 14:13
see my ` Addtional -3`
– aircraft
Feb 9 '17 at 14:40
add a comment |
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 withls
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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