尝试git clone存储库时出现错误:
git clone https://github.com/laradock/laradock.git
Cloning into 'laradock'...
remote: Enumerating objects: 8606, done.
remote: Total 8606 (delta 0), reused 0 (delta 0), pack-reused 8606
Receiving objects: 100% (8606/8606), 8.09 MiB | 6.92 MiB/s, done.
Resolving deltas: 100% (4551/4551), done.
fatal: multiple updates for ref 'refs/remotes/origin/LaraDock-ToolBox' not allowed
Run Code Online (Sandbox Code Playgroud)
我尝试克隆的任何回购都在发生这种情况。我正在git version 2.21.0通过进行安装homebrew。
还有其他人迷惑过这个问题吗?不太确定这里发生了什么...
谢谢!
我正在尝试golang-migrate将 sql 文件迁移到我的 postgresql 数据库中。我可能做错了,但是当我运行命令进行迁移时,它说找不到方案:
$ go run ./cmd/ migrate
2022/04/05 16:20:29 no scheme
exit status 1
Run Code Online (Sandbox Code Playgroud)
这是代码:
// package dbschema contains the database schema, migrations, and seeding data.
package dbschema
import (
"context"
_ "embed" // Calls init function.
"fmt"
"log"
"github.com/golang-migrate/migrate/v4"
"github.com/golang-migrate/migrate/v4/database/postgres"
"github.com/jmoiron/sqlx"
"github.com/jonleopard/bootstrap/pkg/sys/database"
_ "github.com/lib/pq"
)
var (
//go:embed sql/000001_schema.up.sql
schemaDoc string
//go:embed sql/seed.sql
seedDoc string
)
// Migrate attempts to bring the schema for db up to date with the migrations
// defined in …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Postico 连接到本地机器上的 docker postgreSQL 容器。
我尝试连接到 0.0.0.0、localhost 和 127.0.0.1。每个给我以下错误:
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
0.0.0.0 给了我一个类似但更小的错误:
could not connect to server: Connection refused
Is the server running on host "0.0.0.0" and accepting
TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
这是我的 docker-compose 文件: …
我有三个 docker 容器(postgresql、adminer 和 go/migrate),并且我已将 adminer 和 postgres 端口暴露给主机。我可以在浏览器中访问adminer,postico也可以连接到数据库。当我尝试从管理员内部连接到数据库时,它会抛出以下错误:
SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP
connections on port 5432? could not connect to server: Address not available
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
Run Code Online (Sandbox Code Playgroud)
迁移容器也会抛出此错误:
error: dial tcp: 127.0.0.1:5432: connect: connection refused
因此,显然存在容器如何相互通信的问题。我需要创建一个 docker 网络吗?
SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running …Run Code Online (Sandbox Code Playgroud)