无法通过sqlplus命令登录,但可以手动登录

问题描述 投票:0回答:1

我正在尝试使用 sqlplus 命令登录我的数据库。所以我传递了我的用户名(aryan)和密码(12345),但它说无效的用户名/密码

但是当我被要求手动输入相同的用户名和密码时,我登录成功了。我不知道出了什么问题

bash-4.4$
sqlplus aryan/12345@localhost:1521/ORCLPDB1

SQL*Plus: Release 19.0.0.0.0 - Production on Sat Feb 24 03:37:54 2024
Version 19.19.0.0.0

Copyright (c) 1982, 2023, Oracle.  All rights reserved.

ERROR:
ORA-01017: invalid username/password; logon denied


Enter user-name: aryan
Enter password:
Last Successful login time: Fri Feb 23 2024 18:10:39 +00:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0

SQL>

如何通过传递用户名/密码使用一行sqlplus命令登录?

sql oracle sqlplus
1个回答
0
投票

sqlplus /nolog << EOF connect aryan/12345@localhost:1521/ORCLPDB1 EOF

--这里的命令使用('<< EOF ... EOF') for passing the connect command to sqlplus without directly specifying the username and password in the command line, so it can allow you to login with encountering the invalid error.

© www.soinside.com 2019 - 2024. All rights reserved.