How to Replace Multiple Tokens in MySQL
Oracle’s MySQL lets companies and developers manage large databases in both a visual and command-line format. Some databases might include tokens (large strings of letters and/or numbers to identify individual users). If you built an application that takes registration codes, those codes might be stored in a MySQL database. You can replace multiple tokens in the database with the “Replace” command. For each token replacement, you just add another string to the command.
Instructions
-
-
1
Open your MySQL database.
-
2
Type the following three lines in the command line:
REPLACE [LOW_PRIORITY | DELAYED]
[INTO] Table [(Column)]
{Valueold1 | Valuenew1}, {Valueold2 | Valuenew2}, {Valueold3 | Valuenew3}… -
-
3
Replace “Table” and “Column” with the names of the MySQL database table and column you’re working with.
-
4
Replace “Valueold1” with the original token of the first one you want to replace.
-
5
Replace “Valuenew1” with the new token.
-
6
Repeat Steps 4 and 5 for every token you want to replace. If you have more than three, just keep adding them onto the end (with commas).
-
7
Hit Enter. The replace command will replace all the tokens at once.
-
1