Results 1 to 4 of 4
  1. #1
    Join Date
    May 2012
    Posts
    16

    Unanswered: How to encrypt the result of a select statement?

    I want to export the data from a database and place it on a csv file to be imported to another database. However, I want some columns from the selected data (result of select statement) to be encrypted. What should I do? Is this possible? How do you decrypt the data during import?

    The original data is from an MS SQL database to be transferred to a PostgreSQL database.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    Using the SELECT OUTFILE and the various encryption functions available in MySQL this is possible. This will output the contents in CSV format with the sensitive data encrypted. Then it is possible to perform operations during a LOAD INTO on the contents being loaded where we decrypt the same information.

    I have prepare a step by step tutorial on how this should be done. MySQL – Exporting/importing confidential information IT Integrated Business Solutions
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

  3. #3
    Join Date
    May 2012
    Posts
    16
    Thank you very much Ronan.
    The tutorial provided is very easy to follow.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    too bad the initial request was for MS SQL, not MySQL

    see http://www.dbforums.com/microsoft-sq...statement.html
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •