Ich will eine PHP-Anwendung zum Laufen bekommen, für die im sql_mode NO_ZERO_IN_DATE und NO_ZERO_DATE nicht gesetzt sein darf.
Per default ist das gesetzt, und ich kann es auch von Hand für die aktuelle Verbindung deaktivieren.
Aber gibt es eine Möglichkeit, das für die PHP-Anwendung zu deaktivieren?
Code
hostingXXXXXX@YYYYY:/$ mysql -u kZZZZZ_ZZZZZ -p -h <db_server_ip> kZZZZZ_ZZZZZZZZ
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 678242
Server version: 5.7.22 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [kZZZZZ_ZZZZZZZZ]> SHOW VARIABLES WHERE Variable_name = 'sql_mode';
+---------------+-----------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------+-----------------------------------------------------------------------------------------------------------------+
| sql_mode | IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+---------------+-----------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
MySQL [kZZZZZ_ZZZZZZZZ]> set session sql_mode = 'IGNORE_SPACE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected, 1 warning (0.00 sec)
Alles anzeigen