dbTalk Databases Forums  

backup/restore table with encrypted data

comp.databases.mysql comp.databases.mysql


Discuss backup/restore table with encrypted data in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cb
 
Posts: n/a

Default backup/restore table with encrypted data - 11-02-2010 , 05:37 AM






hi all,
i have a table that contains aes_encrypted data.
is there a STANDARD way to backup restore it or should i write some
php (or perl or whatelse) for doing this ?
I've tried export/import (via phpmyadmin) and sqldump, but the
restored data is corrupted.
Thank you !
:-)

Reply With Quote
  #2  
Old   
The Natural Philosopher
 
Posts: n/a

Default Re: backup/restore table with encrypted data - 11-02-2010 , 06:07 AM






cb wrote:
Quote:
hi all,
i have a table that contains aes_encrypted data.
is there a STANDARD way to backup restore it or should i write some
php (or perl or whatelse) for doing this ?
I've tried export/import (via phpmyadmin) and sqldump, but the
restored data is corrupted.
Thank you !
:-)
Three ways have worked for me.

Firstly direct backup of the files themselves.

Secondly writing a script that duplicates the table, but sends the AES
data as hex encoded.

Finally, getting the raw data from encrypted or binary BLOB fields,
putting it in a temporary file, and using LOAD_FILE on it.

There may be others.

Reply With Quote
  #3  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: backup/restore table with encrypted data - 11-02-2010 , 06:18 AM



The Natural Philosopher <tnp (AT) invalid (DOT) invalid> wrote:
Quote:
cb wrote:

i have a table that contains aes_encrypted data.
is there a STANDARD way to backup restore it or should i write some
php (or perl or whatelse) for doing this ?
I've tried export/import (via phpmyadmin) and sqldump, but the
restored data is corrupted.

Three ways have worked for me.
....
There may be others.
mysqldump --help
....
--hex-blob Dump binary strings (BINARY, VARBINARY, BLOB) in
hexadecimal format.

Not sure if phpmyadmin has such an option, but it's unsuitable for
reliable backups anyway.


XL

Reply With Quote
  #4  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: backup/restore table with encrypted data - 11-02-2010 , 06:20 AM



El 02/11/2010 12:37, cb escribió/wrote:
Quote:
i have a table that contains aes_encrypted data.
is there a STANDARD way to backup restore it or should i write some
php (or perl or whatelse) for doing this ?
I've tried export/import (via phpmyadmin) and sqldump, but the
restored data is corrupted.
I don't think there's a special column type for encrypted data. I
presume you have a BLOB or BINARY column and your backup software does
not handle binary data properly. The mysqldump command line tool should
do it fine:

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Reply With Quote
  #5  
Old   
cb
 
Posts: n/a

Default Re: backup/restore table with encrypted data - 11-03-2010 , 01:28 AM



On Nov 2, 1:20*pm, "Álvaro G. Vicario"
<alvaro.NOSPAMTH... (AT) demogracia (DOT) com.invalid> wrote:
Quote:
I don't think there's a special column type for encrypted data. I
presume you have a BLOB or BINARY column and your backup software does
that's the point : my aes_encrypted field is "text"
thank you !

Reply With Quote
  #6  
Old   
Álvaro G. Vicario
 
Posts: n/a

Default Re: backup/restore table with encrypted data - 11-03-2010 , 02:19 AM



El 03/11/2010 8:28, cb escribió/wrote:
Quote:
On Nov 2, 1:20 pm, "Álvaro G. Vicario"
alvaro.NOSPAMTH... (AT) demogracia (DOT) com.invalid> wrote:
I don't think there's a special column type for encrypted data. I
presume you have a BLOB or BINARY column and your backup software does

that's the point : my aes_encrypted field is "text"
Well, as you already guessed, the function returns a binary string:

http://dev.mysql.com/doc/refman/5.1/...on_aes-encrypt



--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.