MySQL can't create pid file: Permission Denied
I'm using MySQL on my macbook pro, which worked fine for the last 2 years.
A week ago it suddenly stopped and I'm not able to restart it again.
I've changed the permission on /usr/local/mysql
to 0777 and also changed the owner to mysql.
When I try to start mysql (sudo /usr/local/mysql/bin/mysqld_safe
or sudo /usr/local/mysql/support-files/mysql.server start
),
I get onf of the following errors:
ERROR! The server quit without updating PID file (/usr/local/mysql/data/[COMPUTERNAME].pid)
or
mysqld_safe mysqld from pid file /usr/local/mysql/data/[COMPUTERNAME].pid ended.
When I open the .err file, I see this errors:
140222 8:10:30 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/usr/local/mysql/data/[COMPUTERNAME].pid' (Errcode: 13)
140222 8:10:30 [ERROR] Can't start server: can't create PID file: Permission denied
Edit:
Here is the ouput of sudo ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 36 root wheel 1292 Feb 20 21:16 /
drwxr-xr-x@ 12 root wheel 408 Oct 26 10:12 /usr
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
lrwxr-xr-x 1 root wheel 27 Feb 22 09:06 /usr/local/mysql -> mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 17 _mysql wheel 578 Feb 22 09:06 /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 10 _mysql wheel 340 Feb 22 09:07 /usr/local/mysql/data
Running ls -ld /usr/local/mysql/data/*.pid
gives ls: /usr/local/mysql/data/*.pid: No such file or directory
mysql root osx-mavericks
add a comment |
I'm using MySQL on my macbook pro, which worked fine for the last 2 years.
A week ago it suddenly stopped and I'm not able to restart it again.
I've changed the permission on /usr/local/mysql
to 0777 and also changed the owner to mysql.
When I try to start mysql (sudo /usr/local/mysql/bin/mysqld_safe
or sudo /usr/local/mysql/support-files/mysql.server start
),
I get onf of the following errors:
ERROR! The server quit without updating PID file (/usr/local/mysql/data/[COMPUTERNAME].pid)
or
mysqld_safe mysqld from pid file /usr/local/mysql/data/[COMPUTERNAME].pid ended.
When I open the .err file, I see this errors:
140222 8:10:30 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/usr/local/mysql/data/[COMPUTERNAME].pid' (Errcode: 13)
140222 8:10:30 [ERROR] Can't start server: can't create PID file: Permission denied
Edit:
Here is the ouput of sudo ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 36 root wheel 1292 Feb 20 21:16 /
drwxr-xr-x@ 12 root wheel 408 Oct 26 10:12 /usr
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
lrwxr-xr-x 1 root wheel 27 Feb 22 09:06 /usr/local/mysql -> mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 17 _mysql wheel 578 Feb 22 09:06 /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 10 _mysql wheel 340 Feb 22 09:07 /usr/local/mysql/data
Running ls -ld /usr/local/mysql/data/*.pid
gives ls: /usr/local/mysql/data/*.pid: No such file or directory
mysql root osx-mavericks
1
Put the output ofls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data ; ls -ld /usr/local/mysql/data/*.pid
into your question.
– JdeBP
Feb 22 '14 at 17:21
@JdeBP I have updated the question with the output
– Pierre
Feb 22 '14 at 20:06
add a comment |
I'm using MySQL on my macbook pro, which worked fine for the last 2 years.
A week ago it suddenly stopped and I'm not able to restart it again.
I've changed the permission on /usr/local/mysql
to 0777 and also changed the owner to mysql.
When I try to start mysql (sudo /usr/local/mysql/bin/mysqld_safe
or sudo /usr/local/mysql/support-files/mysql.server start
),
I get onf of the following errors:
ERROR! The server quit without updating PID file (/usr/local/mysql/data/[COMPUTERNAME].pid)
or
mysqld_safe mysqld from pid file /usr/local/mysql/data/[COMPUTERNAME].pid ended.
When I open the .err file, I see this errors:
140222 8:10:30 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/usr/local/mysql/data/[COMPUTERNAME].pid' (Errcode: 13)
140222 8:10:30 [ERROR] Can't start server: can't create PID file: Permission denied
Edit:
Here is the ouput of sudo ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 36 root wheel 1292 Feb 20 21:16 /
drwxr-xr-x@ 12 root wheel 408 Oct 26 10:12 /usr
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
lrwxr-xr-x 1 root wheel 27 Feb 22 09:06 /usr/local/mysql -> mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 17 _mysql wheel 578 Feb 22 09:06 /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 10 _mysql wheel 340 Feb 22 09:07 /usr/local/mysql/data
Running ls -ld /usr/local/mysql/data/*.pid
gives ls: /usr/local/mysql/data/*.pid: No such file or directory
mysql root osx-mavericks
I'm using MySQL on my macbook pro, which worked fine for the last 2 years.
A week ago it suddenly stopped and I'm not able to restart it again.
I've changed the permission on /usr/local/mysql
to 0777 and also changed the owner to mysql.
When I try to start mysql (sudo /usr/local/mysql/bin/mysqld_safe
or sudo /usr/local/mysql/support-files/mysql.server start
),
I get onf of the following errors:
ERROR! The server quit without updating PID file (/usr/local/mysql/data/[COMPUTERNAME].pid)
or
mysqld_safe mysqld from pid file /usr/local/mysql/data/[COMPUTERNAME].pid ended.
When I open the .err file, I see this errors:
140222 8:10:30 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/usr/local/mysql/data/[COMPUTERNAME].pid' (Errcode: 13)
140222 8:10:30 [ERROR] Can't start server: can't create PID file: Permission denied
Edit:
Here is the ouput of sudo ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 36 root wheel 1292 Feb 20 21:16 /
drwxr-xr-x@ 12 root wheel 408 Oct 26 10:12 /usr
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
lrwxr-xr-x 1 root wheel 27 Feb 22 09:06 /usr/local/mysql -> mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 17 _mysql wheel 578 Feb 22 09:06 /usr/local/mysql-5.6.16-osx10.7-x86_64
drwxr-xr-x 10 _mysql wheel 340 Feb 22 09:07 /usr/local/mysql/data
Running ls -ld /usr/local/mysql/data/*.pid
gives ls: /usr/local/mysql/data/*.pid: No such file or directory
mysql root osx-mavericks
mysql root osx-mavericks
edited Jan 23 at 0:07
JakeGould
31.4k1096138
31.4k1096138
asked Feb 22 '14 at 8:14
PierrePierre
108115
108115
1
Put the output ofls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data ; ls -ld /usr/local/mysql/data/*.pid
into your question.
– JdeBP
Feb 22 '14 at 17:21
@JdeBP I have updated the question with the output
– Pierre
Feb 22 '14 at 20:06
add a comment |
1
Put the output ofls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data ; ls -ld /usr/local/mysql/data/*.pid
into your question.
– JdeBP
Feb 22 '14 at 17:21
@JdeBP I have updated the question with the output
– Pierre
Feb 22 '14 at 20:06
1
1
Put the output of
ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data ; ls -ld /usr/local/mysql/data/*.pid
into your question.– JdeBP
Feb 22 '14 at 17:21
Put the output of
ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data ; ls -ld /usr/local/mysql/data/*.pid
into your question.– JdeBP
Feb 22 '14 at 17:21
@JdeBP I have updated the question with the output
– Pierre
Feb 22 '14 at 20:06
@JdeBP I have updated the question with the output
– Pierre
Feb 22 '14 at 20:06
add a comment |
1 Answer
1
active
oldest
votes
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
There you have it, right in front of you. Execute (directory traversal) permission denied. To the mysql user and indeed to everyone else.
The permissions and ownership of /usr/local
are a widely-hit problem in Mac OS 10, for many reasons that I'm not going to elaborate here.
chmod a+x /usr/local(run as the superuser of course) is your friend.
Avoid suggestions to change the ownership or group of the directory. They are a security disaster waiting to happen, as several people have noted in places where this has come up before.
I had to add write perms to wheel group and it workedsudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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
});
}
});
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%2fsuperuser.com%2fquestions%2f720202%2fmysql-cant-create-pid-file-permission-denied%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
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
There you have it, right in front of you. Execute (directory traversal) permission denied. To the mysql user and indeed to everyone else.
The permissions and ownership of /usr/local
are a widely-hit problem in Mac OS 10, for many reasons that I'm not going to elaborate here.
chmod a+x /usr/local(run as the superuser of course) is your friend.
Avoid suggestions to change the ownership or group of the directory. They are a security disaster waiting to happen, as several people have noted in places where this has come up before.
I had to add write perms to wheel group and it workedsudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
add a comment |
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
There you have it, right in front of you. Execute (directory traversal) permission denied. To the mysql user and indeed to everyone else.
The permissions and ownership of /usr/local
are a widely-hit problem in Mac OS 10, for many reasons that I'm not going to elaborate here.
chmod a+x /usr/local(run as the superuser of course) is your friend.
Avoid suggestions to change the ownership or group of the directory. They are a security disaster waiting to happen, as several people have noted in places where this has come up before.
I had to add write perms to wheel group and it workedsudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
add a comment |
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
There you have it, right in front of you. Execute (directory traversal) permission denied. To the mysql user and indeed to everyone else.
The permissions and ownership of /usr/local
are a widely-hit problem in Mac OS 10, for many reasons that I'm not going to elaborate here.
chmod a+x /usr/local(run as the superuser of course) is your friend.
Avoid suggestions to change the ownership or group of the directory. They are a security disaster waiting to happen, as several people have noted in places where this has come up before.
drw-r--r-- 49 root wheel 1666 Feb 22 09:06 /usr/local
There you have it, right in front of you. Execute (directory traversal) permission denied. To the mysql user and indeed to everyone else.
The permissions and ownership of /usr/local
are a widely-hit problem in Mac OS 10, for many reasons that I'm not going to elaborate here.
chmod a+x /usr/local(run as the superuser of course) is your friend.
Avoid suggestions to change the ownership or group of the directory. They are a security disaster waiting to happen, as several people have noted in places where this has come up before.
edited Apr 13 '17 at 12:45
Community♦
1
1
answered Feb 23 '14 at 12:24
JdeBPJdeBP
22.6k14990
22.6k14990
I had to add write perms to wheel group and it workedsudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
add a comment |
I had to add write perms to wheel group and it workedsudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
I had to add write perms to wheel group and it worked
sudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
I had to add write perms to wheel group and it worked
sudo chmod -R g+w /usr/local/mysql
– michalzuber
Jul 6 '16 at 7:59
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f720202%2fmysql-cant-create-pid-file-permission-denied%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
1
Put the output of
ls -ld / /usr /usr/local /usr/local/mysql /usr/local/mysql/data ; ls -ld /usr/local/mysql/data/*.pid
into your question.– JdeBP
Feb 22 '14 at 17:21
@JdeBP I have updated the question with the output
– Pierre
Feb 22 '14 at 20:06