无法连接到服务器

时间:2019-11-28 19:34:59

标签: python postgresql docker

大家好,我是编码新手。我想在命令行上运行我的python文件。为此,我首先执行:

docker image build -t se .

使用以下命令启动容器:

docker container run --rm -it --name se -p 5432:5432 se

这使我能够通过端口5432连接到PostgreSQL。

我在命令行上收到以下消息:

2019-11-28 18:50:01.004 UTC [32] LOG:  received fast shutdown request
waiting for server to shut down....2019-11-28 18:50:01.005 UTC [32] LOG:  aborting any active transactions
2019-11-28 18:50:01.006 UTC [32] LOG:  background worker "logical replication launcher" (PID 39) exited with exit code 1
2019-11-28 18:50:01.067 UTC [34] LOG:  shutting down
2019-11-28 18:50:01.090 UTC [32] LOG:  database system is shut down
done
server stopped

PostgreSQL init process complete; ready for start up.

2019-11-28 18:50:01.124 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2019-11-28 18:50:01.124 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2019-11-28 18:50:01.125 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-11-28 18:50:01.137 UTC [55] LOG:  database system was shut down at 2019-11-28 18:50:01 UTC
2019-11-28 18:50:01.140 UTC [1] LOG:  database system is ready to accept connections

此后,我打开另一个命令窗口并假设我的服务器正在运行,运行python文件

MacBook-Pro:Desktop nousheen$ python3 juiceboard.py

Traceback (most recent call last):
  File "juiceboard.py", line 13, in <module>
    table = juicetables[0]
IndexError: list index out of range

我不确定该怎么做。有人可以帮我吗?

0 个答案:

没有答案
相关问题