Tuesday, March 2, 2010

How can I turn off MySQL strict mode? or Solving Incorrect integer value problem with MySQL 5 strict-mode

To turn off strict_mode in MySQL

This can be done in two ways...

Open your "my.ini" file within the MySQL installation directory, and look for the text "sql-mode".

Find:
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Replace with:

# Set the SQL mode to strict
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

Or, you can run an SQL query within your database management tool, such as phpMyAdmin:

SET @global.sql_mode= '';

Wednesday, February 17, 2010

Function set_magic_quotes_runtime() is deprecated in PHP 5.3.0

It's better to change the error_reporting line because there are a few other deprecated functions.

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

You need to wrap this in a test for PHP version 5.3 because E_DEPRECATED only became available as of 5.3.


Another method is

find:
set_magic_quotes_runtime(0);
and replace:
ini_set("magic_quotes_runtime", 0);

Friday, January 15, 2010

To view apache error log

tail -f /usr/local/apache/logs/error_log | grep betaisc