After we discuss how to access the database and delete tables using MySQL and also Linux Debian/Ubuntu. Now we will try to use some commands that are a little complicated but often used in the implementation of database management.
A frequently used command is “UPDATE“, this update command is a command that will execute data on the database table so that the data can be updated quickly. Usually the “UPDATE” command will be followed by certain conditions, such as using the “where condition=” clause, where this results in only data that meets the criteria to be changed. However, without using the “where condition=” clause, all data in the selected table will be changed with the new data.
For Example: Change the name on the table “mytable” with “JACK” on the data that has the id number “1“.
Then the next command that is a little complicated and rarely used is the “REPLACE” command, the replace command itself is actually almost similar to “UPDATE” as the parent. However, the “REPLACE” command will only replace part/all of the information in the same data as the one that has been specified.
For Example: If letter “A” is found in the data with the id number “1“, it will be replaced by letter “U“.
The following are examples of “UPDATE” and “REPLACE” commands used to point the old domain to the new domain on the WordPress website. As you can see the command “UPDATE” and followed by “REPLACE” will only change the same data as the data that has been specified and found in the database table.
This command will replace the old domain https://www.old.com with the new domain https://www.new.com.