Anonymize of a mysql database

7.3k views Asked by At

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?

1

There are 1 answers

0
Piemol On

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.