连接 C 语言中的安格尔

发布于 2024-07-29 12:28:43 字数 590 浏览 5 评论 0原文

我需要通过 OpenAPI 连接到 Ingres 提供的 demodb,Ingres 和 C 应用程序都在 Windows 上运行。 我所做的:

  1. 在 Ingres 网络实用程序中创建了一个名为“usernode”的“节点”。
  2. 在 Ingres 安装中创建用户帐户(名为“用户”,密码为“用户”)和 Windows 用户管理(相同的凭据)。
  3. 在数据库中向用户授予必要的权限。
  4. 在 C 代码中,我使用 IIAPI_CONNPARM 结构调用了 IIapi_connect() 函数。 使用过的会员: co_target = "用户节点::demodb", co_username = "用户", co_password = "user"

但 IIapi_connect() 调用返回错误:

“用户提供了一个 vnode 作为数据库名称 (vnode::dbname) 的一部分,但缺少该 vnode 的连接信息。使用 NETUTIL 输入 vnode 的连接信息。 ”

有人知道“节点”这个奇怪的概念吗?

成功连接所需的最少步骤(数据库管理和函数参数传递)是什么?

I need to connect to an Ingres supplied demodb through OpenAPI, both Ingres and C application running on windows. What i have done:

  1. Created a "node" in the Ingres Network Utility named "usernode".
  2. created user accounts in the Ingres installation (named "user" password "user") and in the Windows user management (the same creds.)
  3. Granted necessary privileges to the user in the database.
  4. In C code i have called IIapi_connect() function with an IIAPI_CONNPARM structure.
    Used members:
    co_target = "usernode::demodb",
    co_username = "user",
    co_password = "user"

But IIapi_connect() call returns an error:

"User provided a vnode as part of the database name (vnode::dbname), but connection information for that vnode is missing. Enter connection information for the vnode using NETUTIL."

Anybody knows something that is a weird concept "node"?

What are the minimum steps (in the database administration and the function parameters passing) necessary for the successful connect?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无妨# 2024-08-05 12:28:43

您收到以下错误是因为您的用户 ID 尚未添加到服务器。

“用户提供了一个 vnode 作为
数据库名称(vnode::dbname),但是
该 vnode 的连接信息
不见了。 输入连接
vnode 的信息使用
NETUTIL。”

我猜测正在传递的用户 ID 是在虚拟节点(又名 vnode)定义中定义的,并且该用户需要添加到服务器上的用户列表中。以下内容将通过命令添加用户行,将 USERNAME 更改为您要添加的用户名:

对于 Windows:

echo "create user USERNAME\g" | sql iidbdb

对于 UNIX/Linux/OS X:

sql iidbdb <<EOSQL
create user USERNAME\g
\q

或者,您可以在连接中使用动态 vnode,以便 co_target 指定所有连接信息(包括用户详细信息):

@server,protocol,listen_address[user,password]::database

例如

@localhost,tcp_ip,II[ingres,secret]::iidbdb

,如果您想查看 Ingres 的 OpenAPI 代码的工作示例,请查看 Ingres PECL 扩展名。

You get the following error because your user id has not been added to the server.

"User provided a vnode as part of the
database name (vnode::dbname), but
connection information for that vnode
is missing. Enter connection
information for the vnode using
NETUTIL."

I am guessing that the user id being passed across is defined in the virtual node (aka vnode) definition and it's that user that needs to be added to the user list on the server. The following will add a user from the command line, change USERNAME to the username you wish to add:

For Windows:

echo "create user USERNAME\g" | sql iidbdb

For UNIX/Linux/OS X:

sql iidbdb <<EOSQL
create user USERNAME\g
\q

Alternatively you can use a dynamic vnode in your connection such that co_target specifies all the connection information (including user details):

@server,protocol,listen_address[user,password]::database

for example

@localhost,tcp_ip,II[ingres,secret]::iidbdb

If you want to see a working example of OpenAPI code for Ingres take a look at the Ingres PECL extension.

兲鉂ぱ嘚淚 2024-08-05 12:28:43
  1. 您必须在操作系统中创建一个带有密码的帐户。
  2. 您必须使用与操作系统中相同的用户名和密码创建节点。 例如,不要忘记将“连接信息”块中的“远程节点”参数分配给“localhost”(!)。 这是一个真实的地址(!)。 “监听地址”参数在内部转换为端口。 保留“II”。
  3. 在 VDBA 中,您可能已经在管理节点内创建了一个“用户”帐户。 因此,该帐户不应该有任何密码(!)。 您可以通过输入现有密码复选框“删除旧密码”来删除它。
  4. 对于授权,通常应使用进程的凭据。
  5. 因此,只保留 user::demodb 参数 co_target = "usernode::demodb"。

任何问题?

  1. You must create an account WITH password in the OS.
  2. You must create a node with SAME username and password as in the OS. Don't forget to assign the "Remote Node" parameter in the "Connection Information" block to "localhost" (!) for example. It is an REAL ADDRESS(!). "Listen Address" parameter converts to a port internally. Leave it "II".
  3. In the VDBA you, probably, have created an "user" account WITHIN THE ADMIN NODE. So, that account SHOULDN'T have ANY PASSWORD(!). You can delete it by entering existing password checking box "Delete Old Password".
  4. For an authorization, normally shold be used process' credentials.
  5. So, leave only user::demodb parameter co_target = "usernode::demodb".

Any questions?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文