Forcing mySQL into 'TRADITIONAL' (strict) mode?

jez9999

Well-Known Member
Jun 10, 2005
87
0
156
I've just switched my WHM to start using mySQL 5.0.27-standard. Unfortunately, mySQL defaults to being incredibly stupid, and doing things like 'truncating' a string if you try and insert it into a numeric column. hint: it should fail and return an error.

However, it does have a strict mode that can be enabled by, according to the documentation, passing the argument --sql-mode="TRADITIONAL" to the mysql daemon when it starts. I guess cPanel handles the starting of the mySQL daemon, but unsurprisingly I have no idea how it does it. Does anyone know whether uses the instance manager (in which case this could probably be configured using the /etc/my.cnf file) or whether cPanel manually launches the mySQL daemon?

In any case, how can I force mySQL into its 'traditional' mode on startup on my cPanel system? I want mySQL always to be in strict mode.
 

sierrablue

Member
Aug 30, 2005
19
0
151
cPanel Access Level
Root Administrator
If you look into /etc/rc.d/init.d/mysql it says:
Code:
# Give extra arguments to mysqld with the my.cnf file. This script may
      # be overwritten at next upgrade.
      echo $echo_n "Starting MySQL"
      $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file >/dev/null 2>&1 &
      wait_for_pid created
So, just do it what it says and edit /etc/my.cnf