Search

I'll be at


I support





Subscribe

Recent entries

Archives by subject

Archives by date

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
5
Feb

Running MySQL 5 as MySQL 4

I use MySQL 5 as the default database for the work that I usually do.

Today I came across a situation where I needed to test some MySQL 4 functionality.

An option was to install MySQL 4 on another port (not the standard 3306).

However, an easier option is to simply switch the MySQL mode.

/* show the current sql mode */
SELECT @@GLOBAL.sql_mode;

/* change the settings to mysql 4 mode */
/* the 'GLOBAL' keyword changes the mode for all clients that connect from that time on */

SET GLOBAL sql_mode = 'NO_FIELD_OPTIONS,HIGH_NOT_PRECEDENCE';
More information can be found at: http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html

Comments