The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Forcing mySQL into 'TRADITIONAL' (strict) mode?

Discussion in 'General Discussion' started by jez9999, Dec 17, 2006.

  1. jez9999

    jez9999 Well-Known Member

    Joined:
    Jun 10, 2005
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  2. sierrablue

    sierrablue Member

    Joined:
    Aug 30, 2005
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  3. jez9999

    jez9999 Well-Known Member

    Joined:
    Jun 10, 2005
    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    6
    This seems to have worked. Cheers.
     
Loading...

Share This Page