Monthly Archives: September 2010

You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

Error Code: 1175
You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

Every found that kind of error when trying to update rows in mysql? It’s because you tried to update a table without a WHERE that uses a KEY column (err …).

Anyway, The quick fix is to add SET SQL_SAFE_UPDATES=0; before your update query. Here’s the example:

SET SQL_SAFE_UPDATES=0;
DELETE FROM people WHERE person_status = 'deceased';
Tagged , , ,

Enable PHP in Apache userdir in Lucid Lynx (Ubuntu 10.04)

If you’re using php + apache in Lucid Lynx (Ubuntu 10.04), you’ll notice that the php is disabled when you’re using userdir module (http://localhost/~yourusername). To enable it, open /etc/apache2/mods-enabled/php5.conf (alt+F2, then type gksudo gedit /etc/apache2/mods-enabled/php5.conf) and comment this part (add ‘#’ character in every line):


    
        php_admin_value engine Off
    

The result should be like this:

#
#    
#        php_admin_value engine Off
#    
#

Save the file, then restart the apache by typing sudo /etc/init.d/apache2 restart in terminal.

(taken from http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=1478721)

Tagged , , , ,