简体   繁体   English

ora-1017无效的用户名/密码; 使用occi连接拒绝登录

[英]ora-1017 invalid username/password; logon denied using occi connection

I'm getting an ora-1017 error when trying to connect to my local oracle database(version 11.2.0.3) on an oracle linux version 5 virtual machine using occi. 尝试使用occi连接到Oracle Linux版本5虚拟机上的本地oracle数据库(版本11.2.0.3)时,出现ora-1017错误。
Connection code piece: 连接代码段:

  user = "MY_USERNAME";
  passwd = "MY_PASSWORD";
  db = "localhost:1521/my_instance_name";

  env = Environment::createEnvironment(Environment::DEFAULT);

  try
  {
    con = env->createConnection(user, passwd, db);
  }
  catch (SQLException& ex)
  {
    cout << ex.getMessage();

    exit(EXIT_FAILURE);
  } 

- I can connect to the schema using sqlplus. -我可以使用sqlplus连接到架构。
- I tried setting SEC_CASE_SENSITIVE_LOGON to false, didn't help. -我尝试将SEC_CASE_SENSITIVE_LOGON设置为false,但没有帮助。
- The schema was created using uppercase username and password, I'm giving my variables uppercase values too, and as far as I know OCCI casts the credentials to uppercase anyway so it should work. -该架构是使用大写的用户名和密码创建的,我也为变量提供了大写的值,据我所知,OCCI始终将凭据转换为大写,因此它应该可以工作。
- ORACLE_SID environment variable is properly set, as well as the tnsnames.ora data too. -正确设置了ORACLE_SID环境变量以及tnsnames.ora数据。
- By the way, this code was tested first on my host pc(win10) using visual studio 2010, and it was working properly, but not on my linux virtual machine(using virtualbox). -顺便说一句,此代码首先使用Visual Studio 2010在我的主机pc(win10)上进行了测试,并且工作正常,但在我的linux虚拟机(使用virtualbox)上却没有。 I tried it using the host stated in tnsnames.ora and localhost both, still getting the same issue, but sqlplus lets me connect using both localhost and the tnsnames host. 我尝试使用tnsnames.ora和localhost中指定的主机进行尝试,仍然遇到相同的问题,但是sqlplus允许我同时使用localhost和tnsnames主机进行连接。

I tried everything I could find on google, but still nothing, so if anyone has any useful tips it would be highly appreciated. 我尝试了我在google上可以找到的所有内容,但仍然没有,因此,如果有人有任何有用的提示,将不胜感激。

原来,我需要在编译命令中添加-D_GLIBCXX_USE_CXX11_ABI=0标志,它现在可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM