linux下启动数据库的时候,waiting for server to start....stopped waiting pg_ctl:could not start server
因为我在root下下载的postgresql,之后将其安装之类的,创建了用户名postgres,再把权限给了postgres,之后启动数据库发现有问题,一直无法启动数据库,后来pg_ctl start 启动的时候发现/tmp的权限不够,改了权限就好了。启动前:启动后:问题:pg启动异常could not open lock file “/tmp/.s.PGSQL.5432.lock”:修改tmp权
因为我在root下下载的postgresql,之后将其安装之类的,创建了用户名postgres,再把权限给了postgres,之后启动数据库发现有问题,一直无法启动数据库,后来pg_ctl start
启动的时候发现/tmp的权限不够,改了权限就好了。
启动前:
启动后:
问题:pg启动异常could not open lock file “/tmp/.s.PGSQL.5432.lock”:
修改tmp权限,chown -R postgres:postgres /tmp
启动成功。
参考文档:
https://blog.51cto.com/bilibili/1969436
出的错:
[postgres@localhost postgresql]$ pg_ctl start -l /usr/local/postgresql/log/pg_server.log
waiting for server to start… stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@localhost postgresql]$ pg_ctl start
waiting for server to start…2021-04-01 13:57:03.968 CST [20882] LOG: starting PostgreSQL 13.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
2021-04-01 13:57:03.969 CST [20882] LOG: listening on IPv6 address “::1”, port 5432
2021-04-01 13:57:03.969 CST [20882] LOG: listening on IPv4 address “127.0.0.1”, port 5432
2021-04-01 13:57:03.970 CST [20882] FATAL: could not open lock file “/tmp/.s.PGSQL.5432.lock”: 权限不够
2021-04-01 13:57:03.972 CST [20882] LOG: database system is shut down
stopped waiting
pg_ctl: could not start server
Examine the log output.
[postgres@localhost postgresql]$ su
密码:
[root@localhost postgresql]# chown -R postgres:postgres /tmp
[root@localhost postgresql]# su postgres
[postgres@localhost postgresql]$ pg_ctl start -l /usr/local/postgresql/log/pg_server.log
waiting for server to start… done
server started
[postgres@localhost postgresql]$ psql
psql (13.1)
成功了。
[postgres@localhost postgresql]$ cat data/postgresql.conf | grep unix_socket_directories
#unix_socket_directories = ‘/tmp’ # comma-separated list of directories
参考链接:
https://blog.csdn.net/huguangshanse00/article/details/40413549?locationNum=5

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐
所有评论(0)