在Oracle和MySQL中都有相应的解决方案,大道至简,这个功能的目的都是类似的。在Oracle中可以通过设置wallet来实现,在10g版本开
无密码登录在一定程度上能够简化流程,对于密码敏感,但是又需要提供访问权限的情况下是一个不错的选择。尤其是在乙方在做一些操作的时候,要密码和给密码是一个纠结的问题。不给没法工作,给了又对信息安全又影响。
在Oracle和MySQL中都有相应的解决方案,大道至简,这个功能的目的都是类似的。
在Oracle中可以通过设置wallet来实现,在10g版本开始支持。而在MySQL中自5.6版本开始可以使用--login-path来实现。
先来看看Oracle中的wallet实现无密码登录,,可以通过mkstore来配置,我们可以使用--help得到命令使用的帮助。
[ora11g@oel1 admin]$ mkstore --help
Oracle Secret Store Tool : Version 11.2.0.1.0 - Production
Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
No wallet location specified.
mkstore [-wrl wrl] [-create] [-createSSO] [-createLSSO] [-createALO] [-delete] [-deleteSSO] [-list] [-createEntry alias secret] [-viewEntry alias] [-modifyEntry alias secret] [-deleteEntry alias] [-createCredential connect_string username password] [-listCredential] [-modifyCredential connect_string username password] [-deleteCredential connect_string] [-help] [-nologo]
我们首先来创建钱包,指定钱包路径为/u02/ora11g/wallet,对于密码还是有一定的要求,太简单也不行。
$ mkstore -wrl /u02/ora11g/wallet -create
Oracle Secret Store Tool : Version 11.2.0.1.0 - Production
Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
Enter password:
Enter password again:
生成钱包后,会在指定的路径下生成两个文件。
$ ll
total 8
-rw------- 1 ora11g dba 3589 May 17 21:37 cwallet.sso
-rw------- 1 ora11g dba 3512 May 17 21:37 ewallet.p12
我们可以指定临时的连接串来配置到钱包里面,比如我们认为test11g是一个临时连接串,可以使用tnsping来测试,确保连接串是可访问的。
$tnsping test11g
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = oel1.oracle.com)(PORT = 1511))) (CONNECT_DATA = (SERVICE_NAME = TEST11G)))
OK (0 msec)
配置完成之后,我们需要在登录之前在sqlnet.ora中配置钱包的路径。sqlnet.ora中需要配置的内容如下:
$ cat sqlnet.ora
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /u02/ora11g/wallet)
)
)
通达CMS是采用PHP+MYSQL进行开发的。支持伪静态设置,可生成google和百度地图,支持自定义url、关键字和描述,利于收录...后台简单明了,代码简洁,采用DIV+CSS 利于SEO,企业建站系统是一套专门用于中小企业网站建设的网站管理系统。
0
SQLNET.WALLET_OVERRIDE=true
这些配置都搞定以后我们就可以指定对应的连接串,对应的用户名密码。
$ mkstore -wrl /u02/ora11g/wallet -createCredential test11g n1 n1
Oracle Secret Store Tool : Version 11.2.0.1.0 - Production
Copyright (c) 2004, 2009, Oracle and/or its affiliates. All rights reserved.
Enter wallet password: l 1
Create credential oracle.security.client.connect_string1
配置完成之后工作就完成了,我们可以简单验证一下。
$ sqlplus /@test11g
SQL*Plus: Release 11.2.0.1.0 Production on Sun May 17 21:45:59 2015
With the Partitioning, OLAP, Data Mining and Real Application Testing options
>
而如果使用MySQL来实现,则需要通过mysql_config_editor来配置。
mysql_config_editor的命令提示如下,可以看出可使用的选项还是相对比较简单的。
[mysql@oel1 ~]$ mysql_config_editor set --help
mysql_config_editor Ver 1.0 Distrib 5.6.23, for linux-glibc2.5 on i686
Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
MySQL Configuration Utility.
Description: Write a login path to the login file.
Usage: mysql_config_editor [program options] [set [command options]]
-?, --help Display this help and exit.
-h, --host=name Host name to be entered into the login file.
-G, --login-path=name
Name of the login path to use in the login file. (Default
: client)
-p, --password Prompt for password to be entered into the login file.
-u, --user=name User name to be entered into the login file.
-S, --socket=name Socket path to be entered into login file.
-P, --port=name Port number to be entered into login file.
-w, --warn Warn and ask for confirmation if set command attempts to
overwrite an existing login path (enabled by default).
(Defaults to on; use --skip-warn to disable.)
我们直接可以通过一个命令来完成配置,制定这个无密码登录的别名为fastlogin
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
C++高性能并发应用_C++如何开发性能关键应用
Java AI集成Deep Java Library_Java怎么集成AI模型部署
Golang后端API开发_Golang如何高效开发后端和API
Python异步并发改进_Python异步编程有哪些新改进
C++系统编程内存管理_C++系统编程怎么与Rust竞争内存安全
Java GraalVM原生镜像构建_Java怎么用GraalVM构建高效原生镜像
Python FastAPI异步API开发_Python怎么用FastAPI构建异步API
C++现代C++20/23/26特性_现代C++有哪些新标准特性如modules和coroutines
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号