English 中文(简体)
切换到Mac 上的 Postgres 用户
原标题:Switch to postgres user on Mac

我想向Mac 上的后印用户 su , 这样我就可以运行后印。

我在这里做错什么了?

delirium:~ anna$ sudo su postgres
delirium:~ anna$

什么都没有发生。如果我试图运行邮后gres, 我就会得到这样的东西:

delirium:~ anna$ sudo pg_ctl -D /usr/local/var/postgres -l      
/usr/local/var/postgres/server.log startpg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.

如果我尝试此选项是为了 su , 我也会有错误 :

delirium:~ anna$ sudo su - postgres
su: no directory
delirium:~ anna$

我还能做什么呢? 我相当肯定后盖子用户的存在。

最佳回答

与后gres 用户没有登录 shell 符合的外观。 请尝试 sudo - u postgres bash

问题回答

PostgreSQL 集成在服务器中。

You would have this file: /Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist

< 加强> 您可以 sudo 以所有者的身份运行 shell 命令( 注意用户名中的下划线 ):

sudo -u _postgres createdb the_database -E UTF8

<强 > 或所有赠款都连接到数据库:

psql -h localhost -U _postgres postgres




相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...

热门标签