Timeline for How to do a regular expression replace in MySQL?
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 28, 2021 at 14:56 | comment | added | RD Ward | I the the lesson is to be very careful about your regular expression. | |
Aug 23, 2018 at 9:36 | comment | added | CharlesM | One more confirmation: I enjoyed this method, until I started to get errors about the number of columns not maching the expected value ( = broken the whole db / table). | |
Apr 19, 2018 at 22:38 | comment | added | RD Ward | Years late to the answer @speshak but the reason I chose to access the file like this was because I originally very nervous for the same reasons as mentioned above. At the time it seemed like separating the "find the file" part from the "replace" part would make the code easier to read before I submitted it | |
Apr 19, 2018 at 22:29 | history | edited | RD Ward | CC BY-SA 3.0 |
added 303 characters in body
|
Jun 9, 2015 at 16:56 | comment | added | eggmatters | Having used this method in the past, I aggre with Raul, this is very risky. You need to be absolutely certain as well, that your string is not elswhere in your dataset. | |
Aug 25, 2014 at 1:39 | review | Suggested edits | |||
Aug 25, 2014 at 1:42 | |||||
May 15, 2014 at 15:50 | comment | added | Raul Luna | Very risky, and unpractical with big data sets, or with referential integrity in place: for remove the data and then insert it again you will have to turn referential integrity off, leaving in practice your database off also. | |
S Jul 5, 2012 at 16:02 | history | suggested | Teun Zengerink | CC BY-SA 3.0 |
improved formatting
|
Jul 5, 2012 at 13:30 | review | Suggested edits | |||
S Jul 5, 2012 at 16:02 | |||||
Mar 23, 2012 at 16:17 | comment | added | speshak | Seems strange to me that you'd use find like that, I would shorten the command to sed -i 's/old_string/new_string/g' /path/to/dump.sql | |
Feb 27, 2012 at 5:33 | comment | added | Piskvor left the building | Okay, that should work, too; I didn't consider an offline replace. Nice out-of-the-box thinking there! | |
Feb 26, 2012 at 19:52 | history | answered | RD Ward | CC BY-SA 3.0 |