How to make sql-mode=“NO_ENGINE_SUBSTITUTION” permanent in MySQL my.cnf

前端 未结 13 1481
一整个雨季
一整个雨季 2020-12-13 12:52

UPDATE FIXED 1/18/15

After we recently updated to MySQL 5.6.27 (from the Ubuntu repo), this option now works. So this appears to have been a problem with the previ

相关标签:
13条回答
  • 2020-12-13 12:53

    Woks fine for me on ubuntu 16.04. path: /etc/mysql/mysql.cnf

    and paste that

    [mysqld]
    #
    # * Basic Settings
    #
    sql_mode = "NO_ENGINE_SUBSTITUTION"
    
    0 讨论(0)
  • 2020-12-13 12:57

    It should be:

    [mysqld]
    sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
    

    instead of

    [mysqld]
    sql_mode="NO_ENGINE_SUBSTITUTION"
    

    then restart mysqld service.

    0 讨论(0)
  • 2020-12-13 12:57

    For me it was a permission problem.

    enter:

    mysqld --verbose --help | grep -A 1 "Default options"
    

    [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored.

    So try to execute the following, and then restart the server

    chmod 644 '/etc/mysql/my.cnf'
    

    It will give mysql access to read and write to the file.

    0 讨论(0)
  • 2020-12-13 12:58

    [Fixed] Server version: 10.1.38-MariaDB - mariadb.org binary distribution

    Go to: C:\xampp\mysql\bin open my.ini in notepad and find [mysqld] (line number 27) then after this line(line no 28) just type: skip-grant-tables

    save the file and then reload the phpmyadmin page.It worked for me.

    0 讨论(0)
  • 2020-12-13 13:00

    For me both keys for sql-mode worked. Whether I used

    # dash no quotes
    sql-mode=NO_ENGINE_SUBSTITUTION
    

    or

    # underscore no quotes
    sql_mode=NO_ENGINE_SUBSTITUTION
    

    in the my.ini file made no difference and both were accepted, as far as I could test it.

    What actually made a difference was a missing newline at the end of the my.ini file.

    So everyone having problems with this or similar problems with my.ini/my.cnf: Make sure there is a blank line at the end of the file!

    Tested using MySQL 5.7.27.

    0 讨论(0)
  • 2020-12-13 13:01

    My problem was that I had spaces in between the options on 5.7.20. Removing them so the line looked like

    [mysqld]
    sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    
    0 讨论(0)
提交回复
热议问题