Tag Archives: mysql

MySQL Find and Replace

Here’s a simple line of code to perform a MySQL search and replace operation. Update the text between the brackets with your table and the field you want to work in, as well as the string you’re searching for and replacement text.

Fixing Double-Encoded UTF-8 Data in MySQL (Latin-1 to UTF8)

“Double-encoded UTF-8 text (not to mention triple-, quadruple- and so on) are a fairly common problem when dealing with MySQL. This may be due to the fact that the default character set of the connection to the server is Latin-1, but that is not relevant once the data is already corrupt.

Here is how to fix it, in two simple steps, using the mysqldump and mysql commands:

Of course, you should first replace DB_HOST, DB_USER, DB_PASSWORD and DB_NAME with values, corresponding to your database setup.”

This was from some StackExchange (or something like that) reply to a person’s problem, if I remember correctly.

phpMyAdmin, MySQL: The configuration file now needs a secret passphrase (blowfish_secret).

The error “The configuration file now needs a secret passphrase (blowfish_secret).” occurs on Debian 6 Squeeze because computers are shit and everyone sucks balls at writing software properly.

To fix this, you need to manually add a key to the config. This is assuming you already have the config, and that you don’t need to copy/rename the sample config.

Go to this site to get a key: phpMyAdmin Blowfish Secret Generator.

You enter that key into config.inc.php, in your phpmyadmin directory. Debian is usually /etc/phpmyadmin.

Enter it into/add the following line: $cfg['blowfish_secret'] = 'BLOWFISH PASSWORD HERE';
Obviously, you replace the giant letters, that tell you where you put your key, with the key.

The first link I found, when I searched for this, was most useful: Question Defense.

It’s really sad that some packages are still this broken, after more than four years. I experienced this issue for the first time on an x64 build of Debian 6, though I’ve since been met with it on any version of Debian 6.

Debian 7 Wheezy also has this issue, though the configuration file format has been changed somewhat and now the passphrase goes into its own file in /var/lib/phpmyadmin. At least in Debian 7 it gives you information on what it means and how to use it (somewhat) if you look at the config files.