SQL query to update wp_options records that are specific to the host of a WordPress site. Run this query after copying the DB to another server (if this URL is different). Useful for deploying WordPress from a dev server to a live environment.
UPDATE mytable SET columnA=(@temp:=columnA), columnA = columnB, columnB = @temp;
Converts a date or time from one timezone to another. SELECT CONVERT_TZ(now(),’US/Eastern’,’US/Central’);
This is useful for when a WordPress environment goes live; typically the uploads have an absolute URL. UPDATE files SET filepath = REPLACE(filepath,’path/to/search’,’path/to/replace’);
SELECT column FROM table ORDER BY RAND() LIMIT 1