• <i id='CHeU4'><tr id='CHeU4'><dt id='CHeU4'><q id='CHeU4'><span id='CHeU4'><b id='CHeU4'><form id='CHeU4'><ins id='CHeU4'></ins><ul id='CHeU4'></ul><sub id='CHeU4'></sub></form><legend id='CHeU4'></legend><bdo id='CHeU4'><pre id='CHeU4'><center id='CHeU4'></center></pre></bdo></b><th id='CHeU4'></th></span></q></dt></tr></i><div id='CHeU4'><tfoot id='CHeU4'></tfoot><dl id='CHeU4'><fieldset id='CHeU4'></fieldset></dl></div>
  • <legend id='CHeU4'><style id='CHeU4'><dir id='CHeU4'><q id='CHeU4'></q></dir></style></legend>
    • <bdo id='CHeU4'></bdo><ul id='CHeU4'></ul>

    1. <tfoot id='CHeU4'></tfoot>

      1. <small id='CHeU4'></small><noframes id='CHeU4'>

        mysql 中的 AES_ENCRYPT 后无法使用 AES_DECRYPT

        Unable to AES_DECRYPT after AES_ENCRYPT in mysql(mysql 中的 AES_ENCRYPT 后无法使用 AES_DECRYPT)
      2. <legend id='U82CB'><style id='U82CB'><dir id='U82CB'><q id='U82CB'></q></dir></style></legend>

        <small id='U82CB'></small><noframes id='U82CB'>

            <tbody id='U82CB'></tbody>
          <i id='U82CB'><tr id='U82CB'><dt id='U82CB'><q id='U82CB'><span id='U82CB'><b id='U82CB'><form id='U82CB'><ins id='U82CB'></ins><ul id='U82CB'></ul><sub id='U82CB'></sub></form><legend id='U82CB'></legend><bdo id='U82CB'><pre id='U82CB'><center id='U82CB'></center></pre></bdo></b><th id='U82CB'></th></span></q></dt></tr></i><div id='U82CB'><tfoot id='U82CB'></tfoot><dl id='U82CB'><fieldset id='U82CB'></fieldset></dl></div>

                <tfoot id='U82CB'></tfoot>
                  <bdo id='U82CB'></bdo><ul id='U82CB'></ul>
                  本文介绍了mysql 中的 AES_ENCRYPT 后无法使用 AES_DECRYPT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我创建了用户表

                  CREATE  TABLE `user` (
                  `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
                  `first_name` VARBINARY(100) NULL ,
                  `address` VARBINARY(200) NOT NULL ,
                  PRIMARY KEY (`id`))
                  ENGINE = InnoDB
                  DEFAULT CHARACTER SET = utf8
                  COLLATE = utf8_general_ci;
                  

                  我插入了一行:

                  INSERT into user (first_name, address) VALUES (AES_ENCRYPT('Obama', 'usa2010'),AES_ENCRYPT('Obama', 'usa2010'));
                  

                  要选择我使用的这一行:

                  To select this row i used:

                  SELECT AES_DECRYPT(first_name, 'usa2010'), AES_DECRYPT(address, 'usa2010') from user;
                  

                  我得到以下结果.我需要做什么才能看到我的数据.我看不到任何数据.

                  I am getting the following result.What i need to do see my data.No data is visible for me.

                  推荐答案

                  根据手册:

                  AES_ENCRYPT() 加密一个字符串并返回一个二进制字符串.AES_DECRYPT() 解密加密后的字符串并返回原始字符串.

                  AES_ENCRYPT() encrypts a string and returns a binary string. AES_DECRYPT() decrypts the encrypted string and returns the original string.

                  • MySQL 5.1 文档:AES_ENCRYPT()/AES_DECRYPT()
                  • 我不知道为什么在你的情况下它仍然返回一个二进制字符串.不管怎样,试试这个:

                    I don't know why it is still returning a binary string in your case. Anyway, try this:

                    SELECT *, 
                           CAST(AES_DECRYPT(first_name, 'usa2010') AS CHAR(50)) first_name_decrypt 
                    FROM   user
                    

                    并使用first_name_decrypt 而不是first_name.

                    这篇关于mysql 中的 AES_ENCRYPT 后无法使用 AES_DECRYPT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Can#39;t Create Entity Data Model - using MySql and EF6(无法创建实体数据模型 - 使用 MySql 和 EF6)
                  MySQL select with CONCAT condition(MySQL选择与CONCAT条件)
                  Capitalize first letter of each word, in existing table(将现有表格中每个单词的首字母大写)
                  How to retrieve SQL result column value using column name in Python?(如何在 Python 中使用列名检索 SQL 结果列值?)
                  Update row with data from another row in the same table(使用同一表中另一行的数据更新行)
                  Exporting results of a Mysql query to excel?(将 Mysql 查询的结果导出到 excel?)

                    <bdo id='uCiLm'></bdo><ul id='uCiLm'></ul>

                        1. <small id='uCiLm'></small><noframes id='uCiLm'>

                        2. <i id='uCiLm'><tr id='uCiLm'><dt id='uCiLm'><q id='uCiLm'><span id='uCiLm'><b id='uCiLm'><form id='uCiLm'><ins id='uCiLm'></ins><ul id='uCiLm'></ul><sub id='uCiLm'></sub></form><legend id='uCiLm'></legend><bdo id='uCiLm'><pre id='uCiLm'><center id='uCiLm'></center></pre></bdo></b><th id='uCiLm'></th></span></q></dt></tr></i><div id='uCiLm'><tfoot id='uCiLm'></tfoot><dl id='uCiLm'><fieldset id='uCiLm'></fieldset></dl></div>
                            <tfoot id='uCiLm'></tfoot><legend id='uCiLm'><style id='uCiLm'><dir id='uCiLm'><q id='uCiLm'></q></dir></style></legend>
                              <tbody id='uCiLm'></tbody>