sql-mode

How to set sql_mode in my.cnf in MySQL 8?

穿精又带淫゛_ 提交于 2020-02-06 12:39:22
问题 I'm running MySQL 8.0.11 community version. I need to set sql_mode to exclude ONLY_FULL_GROUP_BY in my.cnf so that it's restart safe. I tried the following variants: sql_mode= STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" sql-mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR

How to set sql_mode in my.cnf in MySQL 8?

吃可爱长大的小学妹 提交于 2020-02-06 12:33:27
问题 I'm running MySQL 8.0.11 community version. I need to set sql_mode to exclude ONLY_FULL_GROUP_BY in my.cnf so that it's restart safe. I tried the following variants: sql_mode= STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" sql-mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR

How to get rid of STRICT SQL mode in MySQL

≯℡__Kan透↙ 提交于 2020-01-09 19:21:27
问题 This is a follow up to this question MYSQL incorrect DATETIME format How to get rid of STRICT_TRANS_TABLES once and for all? mysql --help reports the following configs: Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf $ ls /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf ls: /Users/pain/.my.cnf: No such file or directory ls: /etc/mysql/my.cnf: No such file or directory ls: /usr/local/etc/my.cnf: No

How to get rid of STRICT SQL mode in MySQL

巧了我就是萌 提交于 2020-01-09 19:20:45
问题 This is a follow up to this question MYSQL incorrect DATETIME format How to get rid of STRICT_TRANS_TABLES once and for all? mysql --help reports the following configs: Default options are read from the following files in the given order: /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf $ ls /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf ls: /Users/pain/.my.cnf: No such file or directory ls: /etc/mysql/my.cnf: No such file or directory ls: /usr/local/etc/my.cnf: No

How to make Emacs sql-mode recognize MySQL #-style comments?

元气小坏坏 提交于 2020-01-04 04:35:07
问题 I'm reading a bunch of MySQL files that use # (to end-of-line) comments, but my sql-mode doesn't support them. I found the syntax-table part of sql.el that defines /**/ and -- comments, but according to this, Emacs syntax tables support only 2 comment styles. Is there a way to add support for # comments in sql.el easily? 回答1: Emacs-24 sql.el has this built-in! Simply run M-x sql-set-product MySQL RET and the syntax table is set up automatically, as are the font-lock-keywords for all the

Laravel Database Strict Mode

ぃ、小莉子 提交于 2019-12-21 21:22:36
问题 I'm little wonder please help me out. My query is :- Invoice::join('orders', 'orders.invoice_id', '=', 'invoices.id')->groupBy('invoices.id')->get(); Then I have got an error: Syntax error or access violation: 1055 'invoices.reference_number' isn't in GROUP BY When I updated my query according to error then the query is:- $invoices = Invoice::join('orders', 'orders.invoice_id', '=', 'invoices.id')->groupBy('invoices.id','invoices.reference_number','invoices.customer_address_id','invoices

How to set Amazon RDS SQL_MODE with multiple values

南楼画角 提交于 2019-12-21 18:03:18
问题 MySQL allows parameter SQL_MODE to be set to multiple values in the my.cnf file. How can I do the same on Amazon RDS? UPDATE: This problem has been fixed...see below. 回答1: Helpfully it looks like Amazon have fixed this as of May 24th 2016 "The sql_mode parameter can now be set to a list of values for all MySQL and MariaDB versions. The list of values should be correct in all regions as well." https://forums.aws.amazon.com/thread.jspa?threadID=232266 回答2: MySQL allows parameter SQL_MODE to be

How can I get emacs sql-mode to use the mysql config file (.my.cnf)?

故事扮演 提交于 2019-12-20 21:02:17
问题 When I type mysql dbname at the bash prompt, I automatically connect to the database dbname with the username , password , and host information included in my .my.cnf file. When I use M-x sql-mysql in emacs, I am asked for all of this information again. Is there a way that I can get emacs sql mode to use the information in my .my.cnf file? 回答1: I don't think that this is possible but you can set such stuff in the mode configuration itself: (setq sql-connection-alist '((pool-a (sql-product

ONLY_FULL_GROUP_BY not set but still have Error 1140

人走茶凉 提交于 2019-12-11 06:34:08
问题 I am finalizing the implementation of my website but now I have a problem that occurs online that I have not locally. I get this error: failed: Mixing of GROUP columns (MIN (), MAX (), COUNT (), ...) with no GROUP columns is illegal if there is no GROUP BY clause result of a SQL query I searched in lot of forums on the net, most users advise to change the query that I can not / do not want, or they say it was probably in the sql-mode: enabled ONLY_FULL_GROUP_BY of the server My sql-mode is

Emacs how to use ssh tunnel to connect to remote MySQL

試著忘記壹切 提交于 2019-12-04 09:37:44
问题 I have a bunch of remote MySQL servers, that allow connection only from localhost. To connect to them I do the following: ssh host mysql -uuser -psecret -hhost.myhost.com In emacs I configured the connection to local MySQL, using sql-mysql-mode: (setq sql-connection-alist '((pool-a (sql-product 'mysql) (sql-server "localhost") (sql-user "user") (sql-password "secret") (sql-database "") (sql-port 3306)) )) (defun sql-connect-preset (name) "Connect to a predefined SQL connection listed in `sql