解决 dropdb: could not connect to database postgres: could not connect to server:

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
云原生数据库 PolarDB PostgreSQL 版,企业版 4核16GB
推荐场景:
HTAP混合负载
云原生数据库 PolarDB MySQL 版,通用型 2核4GB 50GB
简介: 今天在调试一个脚本的时候遇到这个错误: dropdb: could not connect to database postgres: could not connect to server:  这个脚本调用了postgresql的dropdb命令。

今天在调试一个脚本的时候遇到这个错误:

dropdb: could not connect to database postgres: could not connect to server: 

这个脚本调用了postgresql的dropdb命令。

找了下资料似乎是dropdb时候找的库不对导致的。 由于这个脚本以前是对本机postgreSQL操作的,这次是对remote的postgreSQL操作的,所以测试了一下差异:

./dropdb -U postgres mydbase 默认对本机数据库操作

./dropdb -U postgres dsvdbase -h 10.**.**.**  加上了IP地址,对此IP的数据库操作

 

所以由于脚本所在服务器没有装postgreSQL,出了错, 给这个脚本填加-h解决

相关实践学习
使用PolarDB和ECS搭建门户网站
本场景主要介绍基于PolarDB和ECS实现搭建门户网站。
阿里云数据库产品家族及特性
阿里云智能数据库产品团队一直致力于不断健全产品体系,提升产品性能,打磨产品功能,从而帮助客户实现更加极致的弹性能力、具备更强的扩展能力、并利用云设施进一步降低企业成本。以云原生+分布式为核心技术抓手,打造以自研的在线事务型(OLTP)数据库Polar DB和在线分析型(OLAP)数据库Analytic DB为代表的新一代企业级云原生数据库产品体系, 结合NoSQL数据库、数据库生态工具、云原生智能化数据库管控平台,为阿里巴巴经济体以及各个行业的企业客户和开发者提供从公共云到混合云再到私有云的完整解决方案,提供基于云基础设施进行数据从处理、到存储、再到计算与分析的一体化解决方案。本节课带你了解阿里云数据库产品家族及特性。
目录
相关文章
|
1月前
|
SQL Oracle 关系型数据库
Connect to Autonomous Database Using Oracle Database Tools
Connect to Autonomous Database Using Oracle Database Tools
27 1
|
10月前
|
安全 关系型数据库 MySQL
【报错】sqli-labs靶场搭建出现“Unable to connect to the database: security”
【报错】sqli-labs靶场搭建出现“Unable to connect to the database: security”
720 0
|
10月前
|
关系型数据库 MySQL 数据库
【报错】DVWA遇到Could not connect to the database service. Please check the config file. Database Error
【报错】DVWA遇到Could not connect to the database service. Please check the config file. Database Error
861 0
|
11月前
|
XML 关系型数据库 MySQL
已解决Failed to connect mysql database,please check username and password,or mysql is version8? true
已解决Failed to connect mysql database,please check username and password,or mysql is version8? true
167 0
|
1月前
|
SQL Oracle 关系型数据库
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database
WARNING: Too Many Parse Errors With error=911 When Running a JDBC Application Connected to an Oracle 19c database (
28 2
|
1月前
|
Oracle 关系型数据库
19c 开启Oracle Database Vault
19c 开启Oracle Database Vault
40 1