Postgresql cannot be started due to a permission error

Asked 2 years ago, Updated 2 years ago, 85 views

This is my first post for a beginner.
I installed postgresql to bring the personalized application to the production environment in heroku.
I tried booting and received the following error:

%psql --version
psql (PostgreSQL) 12.2## Deployment Verification

 % Launching brew services start postgresql## postgresql
Error: Permission denied@rb_sysopen-/Users/{username}/Library/LaunchAgent/homebrew.mxcl.postgresql.plist

We thought there was a problem with administrator privileges, so we did the following:

%cd/Users/{username}/Library/LaunchAgent/## Go to the path listed

% ls-la
total8
drwxr-xr-x3 root staff963 12 2019.
drwx ------- @79 {username} staff 2528 229 10:37 ...
-rw -r --r --1 root staff 612312 2019 com.adobe.GC.Invoker-1.0.plist

% sudo chown-R Username## Change Permission to Username
% usage:chown[-fhnv][-R[-H|-L|-P]]owner[:group]file...
       chown[-fhnv][-R[-H|-L|-P]]:group file...

This is what happened and the permissions were not changed.
Programming itself is a beginner, and I have nothing to do with authority.
If you are familiar with this, please reply.

postgresql heroku

2022-09-30 15:54

2 Answers

Wouldn't it be bad to force the permission of a file to be changed to a user?
I didn't actually do it, but wouldn't it work if I started the service with sudo?

Start %sudobrew services start postgresql##postgresql

By the way, chown fails because you did not specify the file (or directory) to which you want to change permissions.


2022-09-30 15:54

I don't think it's a big mistake.

■ Launch Commands
I only know heroku's name, but isn't this cool?

subdo brew services start postgresql

■What to do
As I have pointed out in other answers, it is not proper manners to play with the authority relationship itself because it is in a state where it should be.However, considering the situation, it's not entirely wrong to "move first." (*If you forget the "state to be" after moving, you'll see tears in the future.)

Check the error contents for command errors.

%usage:chown[-fhnv][-R[-H|-L|-P]]owner[:group]file...
       chown[-fhnv][-R[-H|-L|-P]]:group file...

"If you look closely, you can see that ""file"" is pointed out at the end."
Errors are often seen due to typographical errors, so get used to the meaning of the message and the "man command" little by little.


2022-09-30 15:54

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.