1

For testing purposes I want to anonymize our MySql database.

For example we have the next table:

id   |   first_name  |   last_name

54782 |  John        |   Holloway

54824 |  Glen        |   Summers

67782 |  Jessie      |   Hunter

We want to achieve next table after anonymization:

id   |   first_name  |   last_name

54782 |  Glen        |  Hunter

54824 |  Jessie      |  Holloway

67782 |  John        |   Summers

NOTE: there are gaps in between the id's. These id's should not be changed (but may be applied to another person).

How can I achieve this in a MySql query?

Abhik Chakraborty
  • 44,654
  • 6
  • 52
  • 63
jenthe_m
  • 59
  • 1
  • 6
  • Are you ok with duplicate combinations (e.g. two Jessie Holloways)? – René Hoffmann Dec 12 '14 at 12:33
  • For this names it won't be a problem. But we also hold social security numbers which should be unique in the database. So duplicate combinations are not allowed. – jenthe_m Dec 12 '14 at 12:43

1 Answers1

1

Because this question still has no answer...

Shifting data to other rows will help anonymize a bit but would never be my best bet. Instead I would go with this answer to erase all personal information: https://stackoverflow.com/a/260434/3090890

In your case you only would have to write one update statement per table to really anonymize the data and which also executes very fast.

Piemol
  • 857
  • 8
  • 17