我可以使用jdbc驱动程序使用jdbc:postgresql://host:port/database连接到postgresql服务器中的数据库。
但是我想连接到postgresql服务器,并在那里找到数据库列表。当我使用jdbc:postgresql://localhost:5432时,我得到了一个名为
java.sql.SQLException: No suitable driver found for jdbc:postgresql://localhost:5432
是否有其他驱动程序或方法可以在不知道服务器中的数据库名称和查询数据库列表的情况下连接到服务器?
我已经在postgresql中创建了数据库,并想使用像use databaseName这样的命令来连接数据库,但它不是working.What是访问postgresql中特定数据库的命令。
在我的sql中,如果想要连接数据库,我们将使用命令,如use databaseName not working in postgresql。
我肯定这件事已经回答了,但我似乎找不到答案。
我使用Homebrew (brew installed )安装postgresql,它安装到/usr/local/Cellar/postgresql。之后,根据我的说明,我这样做了:
If this is your first install, create a database with:
initdb /usr/local/var/postgres
据我所知,initdb创建了一个新的数据库集群。所以,当我这样做时,是"postgres“数据库名称和数据库本身,还是所有postgresql数据库所需的所有必要位呢?
实际的数据库
我在Ubuntu 10.04.02服务器版本上使用PostgreSQL 8.4。我使用pg_standby恢复数据和数据库恢复,创建了一个recovery.conf,并将其放在/etc/postgresql/8.4/main上,其中有其他的conf文件,并试图使用
sudo service postgresql start
期望服务能够识别我正在使用recovery.conf进行恢复。我发现这个文件被忽略了。然后,我必须将所有的*.conf文件复制到我的数据目录(在我的例子中是/dbdata/ data ),然后,我必须从'postgres‘用户启动数据库,而不是使用init.d中的脚