mysql - disable STRICT_TRANS_TABLES?

Discussion in 'Databases' started by VAHokies, Sep 16, 2016.

  1. I need to disable STRICT_TRANS_TABLES.

    I have an application that is failing because STRICT_TRANS_TABLES is enabled but I can't figure how to disable this.
    Any ideas?

  2. Elshadriel

    Elshadriel Winhost Staff

    Michael likes this.
  3. I tried set session sql_mode = ''; with mysql Workbench and my application still failed. I think this is because Workbench and my application are running in separate sessions. My application is locked - so I can edit it to add this setting.

    I have a local instance of mysql and here I did set global sql_mode = '' and my application worked.
    But I don't have rights (access denied) to run set global sql_mode = '' on my Winhost mysql. And I cannot edit my.cnf on Winhost.

    Other options?

  4. Elshadriel

    Elshadriel Winhost Staff

    Not that I know of. You should be able to set the sql_mode for a session, not globally as you have discovered.
  5. But that is the problem since setting the sql_mode for the session doesn't work since my application is running under a different session.
    Is there anyway for me to run set global sql_mode = '' or can I get special permission to disable strict mode for my account?

    This is very frustrating since I pay a lot for my Winhost web-hosting but a lot of other hosting providers are more flexible in this area.

  6. Elshadriel

    Elshadriel Winhost Staff

    Are you adding the code to your application? and not just running it through MySQL WorkBench? For example, say you have a SELECT statement or calling a stored procedure. Are you adding that code right before that?
  7. Actually, I'm not running any sql queries on my own - the application is something I paid for ( It is a php application with a mysql back-end database. So, I'd prefer not to start modifying this application that I didn't write.

  8. I'm not sure we can make that change on an individual user basis, but if you open a support ticket we can check with a DBA for a definitive answer.

    You might want to bring the issue to the attention of the application builders as well. It could help them improve their product and save someone else the same headaches in the future.
    Elshadriel likes this.

Share This Page