GCP Cloud SQL Proxy – 无法执行二进制文件:执行格式错误

huangapple go评论60阅读模式
英文:

GCP Cloud SQL Proxy - Cannot execute binary file: Exec format error

问题

我在执行 SQL 代理客户端时遇到了一个错误,用于连接从主机到 GCP SQL 的步骤可以在 https://cloud.google.com/sql/docs/postgres/sql-proxy 中找到。

以下是代码部分:

ubuntu@ubuntu22-10:~$ ./cloud_sql_proxy -dir=/cloudsql -instances=project_id+instance=tcp:0.0.0.0:5432 -credential_file=ser_account.json

-bash: ./cloud_sql_proxy: cannot execute binary file: Exec format error

操作系统信息(使用 Mac M1 2021 的 multipass 实例):

Linux ubuntu22-10 5.19.0-29-generic #30-Ubuntu SMP PREEMPT_DYNAMIC aarch64 aarch64 aarch64 GNU/Linux

看起来似乎与文件存在问题。你有什么想法吗?

英文:

I have am error ; when I execute the sql proxy client .
(for connecting from host to GCP SQL https://cloud.google.com/sql/docs/postgres/sql-proxy)

this is the code

ubuntu@ubuntu22-10:~$ ./cloud_sql_proxy -dir=/cloudsql -instances=project_id+instance=tcp:0.0.0.0:5432 -credential_file=ser_account.json

-bash: ./cloud_sql_proxy: cannot execute binary file: Exec format error

OS info ( multipass instance with mac m1 2021):

Linux ubuntu22-10 5.19.0-29-generic #30-Ubuntu SMP PREEMPT_DYNAMIC aarch64 aarch64 aarch64 GNU/Linux

it seems that there are problems with file.

Do you have any idea?

thanks

答案1

得分: 3

我有2个版本。一个旨在在Docker映像中运行,另一个在我的M1 Mac上本地运行。我混淆了amd64和arm64的二进制文件。确保您正在运行适用于您系统的正确二进制文件。

英文:

I had 2 versions. One was intended to run in a Docker image, and the other, locally on my M1 Mac. I mixed up the amd64 and the arm64 binaries. Make sure you're running the correct binary for your system.

huangapple
  • 本文由 发表于 2023年2月6日 18:44:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75360260.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定