简体   繁体   English

ORA-01017: 无效的用户名/密码; 连接时登录被拒绝

[英]ORA-01017: invalid username/password; logon denied when connection

I get the given below error, when I connect localhost (docker - oracle-12.2.0.1) using Go.当我使用 Go 连接localhost (docker - oracle-12.2.0.1)时,出现以下错误。 Same connection is working fine when I connect by table plus .当我通过table plus连接时,相同的连接工作正常。 Please suggest me to resolve this issue.请建议我解决此问题。

Reference 参考

Code代码

conn, err := sql.Open("oracle", "oracle://SYS:Oradoc_db1@localhost/ORCLPDB1.localdomain")
if err != nil {
    fmt.Println("Can't open the driver", err)
    return
}

Error1错误1

ORA-28009: connection as SYS should be as SYSDBA or SYSOPER

Code代码

conn, err := sql.Open("oracle", "oracle://SYSDBA:Oradoc_db1@localhost/ORCLPDB1.localdomain")
if err != nil {
    fmt.Println("Can't open the driver", err)
    return
}

Error2错误2

ORA-01017: invalid username/password; logon denied

The username and password must be same as was specified in a GRANT CONNECT statement.用户名和密码必须与 GRANT CONNECT 语句中指定的相同。 And if you are entering the username and password together the format should be like this: username/password .如果你同时输入用户名和密码,格式应该是这样的: username/password Also check if they are case sensitive or not.还要检查它们是否区分大小写。

try this format:试试这种格式:

 db, err := sql.Open("oracle", "<your username>/<your password>@service_name")
    if err != nil {
        fmt.Println(err)
        return
    }
    defer db.Close()

OR或者

Also confirm golang oracle database driver还要确认golang oracle 数据库驱动

db, err := sql.Open("goracle", username+"/"+password+"@"+host+"/"+database)
if err != nil {
    fmt.Println("... DB Setup Failed") 
    fmt.Println(err)
    return
}
defer db.Close()

暂无
暂无

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

相关问题 ORA-01017:无效的用户名/密码; 登录被拒绝 - ORA-01017: invalid username/password; logon denied ora-01017 无效的用户名/密码登录被拒绝无法使用新连接登录 - ora-01017 invalid username/password logon denied can't logon with the new connection kuali - ORA-01017:用户名/密码无效; 登录被拒绝 - kuali - ORA-01017: invalid username/password; logon denied ORA-01017 无效的用户名/密码登录被拒绝 - ORA-01017 invalid username/password logon denied 给出正确的用户名和密码,得到 ORA-01017: invalid username/password; 登录被拒绝 - giving correct username& password, get ORA-01017: invalid username/password; logon denied ORA-01017: 无效的用户名/密码; 尝试通过 ODP.NET 连接时登录被拒绝 (Oracle.ManagedDataAccess.Client) - ORA-01017: invalid username/password; logon denied when trying to connect via ODP.NET (Oracle.ManagedDataAccess.Client) 安装Zulu后出现“ ORA-01017:无效的用户名/密码;登录被拒绝”异常 - getting “ORA-01017: invalid username/password;logon denied” exception after installing Zulu java.sql.SQLException:ORA-01017:用户名/密码无效; 登录被拒绝 - java.sql.SQLException: ORA-01017: invalid username/password; logon denied Oracle 9i:ORA-01017:无效的用户名/密码; 登录被拒绝 - Oracle 9i: ORA-01017: invalid username/password; logon denied Oracle 11g r2 ORA-01017: 无效的用户名/密码; 通过 JDBC 驱动程序连接时登录被拒绝 - Oracle 11g r2 ORA-01017: invalid username/password; logon denied when connecting via JDBC driver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM