简体   繁体   English

如何从AWS实例读取密钥并将其添加到我的MySQL查询中?

[英]How to read key from aws instance and add into my mysql query?

lets take my query is 让我来查询

Insert into table1 values (AES_ENCRYPT('mypassword', some_secure_key));

I am storing some_secure_key in key management service in aws . 我将aws_secure_key存储在aws的密钥管理服务中。 I want to fetch and use this key in my query . 我想获取并在查询中使用此密钥。

I am running this query from local system. 我正在从本地系统运行此查询。

system detail mysql_version :- 5.7.23 OS:- linux 系统详细信息mysql_version:-5.7.23 OS:-Linux

You need to use AES_DECRYPT for decryption: 您需要使用AES_DECRYPT进行解密:

SELECT description, AES_DECRYPT(description,some_secure_key) 
FROM table1 ;

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

相关问题 Smarty-如何将表单中的值添加到mysql查询中? - Smarty - How to add values from my form to mysql query? 如何从终端连接到 AWS mysql 数据库实例 - How can I connect, from the terminal, to AWS mysql DB instance 如何将 GCP 项目中的 MySQL 实例连接到 AWS Lambda function? - How to connect MySQL instance from GCP project to AWs Lambda function? 如何在插入查询中添加外键值-MySQL-CodeIgniter - How to add foreign key value in insert query - mysql - CodeIgniter 如何从另一个表主键添加mysql外键? - How to Add mysql foreign key from another table primary key? 如何在MySql DATETIME查询中添加#from和#to? - How to add #from and #to in MySql DATETIME query? 无法从我自己的计算机(包括Cloud9)以外的任何计算机访问AWS MySQL实例 - Cannot access AWS MySQL instance from any computer other than my own (including Cloud9) 无法从我的 Java 应用程序访问 mysql 数据库(在 AWS 实例上运行) - Can't access mysql database (running on AWS instance) from my java application 如何在React中从谷歌云sql实例查询mysql - How to query mysql from google cloud sql instance in React 如何在AWS实例中设置与Mysql的jdbc连接? - How to setup jdbc connection to Mysql in AWS instance?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM