Archive for MySQL

Find and Replace Text in MySQL

A simple one-liner for replacing all occurrences of a search string with a replacement string.

UPDATE table SET fieldName = REPLACE(fieldName, 'find', 'replace');

MySQL Error 1148 Fix

Not sure if you’ve seen this error before….

ERROR 1148: The used command is not allowed with this MySQL version

Don’t get discouraged by this error if you’re running a fairly recent version of MySQL. According to MySQL, the error means that the loading of local files is disabled in MySQL configuration. All you need to do is enable loading of local files in the MySQL configuration. There are two ways to go about enabling the loading of local files depending on the type of environment MySQL is setup on.
Read more »

MySQL Query to Find Duplicates

Here’s a handy query for finding duplicates in a table:

For example, suppose you want to find all the contest entries of people that submitted an entry more than once. Read more »