sql-mode

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

二次信任 提交于 2019-12-03 07:00:48
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? 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 'mysql) (sql-server "1.2.3.4") (sql-user "me") (sql-password "mypassword") (sql-database "thedb") (sql-port

Emacs how to use ssh tunnel to connect to remote MySQL

岁酱吖の 提交于 2019-12-03 03:30:35
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-connection-alist'" (eval `(let ,(cdr (assoc name sql-connection-alist)) (flet ((sql-get-login (&rest

How to get rid of STRICT SQL mode in MySQL

倾然丶 夕夏残阳落幕 提交于 2019-11-28 22:55:33
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 such file or directory /etc/my.cnf $ cat /etc/my.cnf [mysqld] sql_mode=NO_ENGINE_SUBSTITUTION But this

How to set sql_mode hibernate

此生再无相见时 提交于 2019-11-28 08:25:41
问题 Is there a way to set the sql_mode (for MySql database) in Hibernate properties or in connection string? Thanks, Stefano 回答1: Yes, as documented sessionVariables property which is defined as follows can be used in JDBC connection string: A comma-separated list of name/value pairs to be sent as SET SESSION ... to the server when the driver connects. List of values goes inside single quotes: sessionVariables=sql_mode='ALLOW_INVALID_DATES,NO_BACKSLASH_ESCAPES' 来源: https://stackoverflow.com

MySQL: Setting sql_mode permanently

隐身守侯 提交于 2019-11-27 14:35:58
Via the MySQL command line client, I am trying to set the global mysql_mode: SET GLOBAL sql_mode = TRADITIONAL; This works for the current session, but after I restart the server, the sql_mode goes back to its default: '', an empty string. How can I permanently set sql_mode to TRADITIONAL? If relevant, the MySQL is part of the WAMP package. Thank you. Add this to your my.cnf file (or my.ini if you're using windows): sql_mode="TRADITIONAL" and restart the server MySQL sql_mode "TRADITIONAL" , a.k.a. "strict mode", is defined by the MySQL docs as: “give an error instead of a warning” when

MySQL: Setting sql_mode permanently

て烟熏妆下的殇ゞ 提交于 2019-11-26 16:49:14
问题 Via the MySQL command line client, I am trying to set the global mysql_mode: SET GLOBAL sql_mode = TRADITIONAL; This works for the current session, but after I restart the server, the sql_mode goes back to its default: '', an empty string. How can I permanently set sql_mode to TRADITIONAL? If relevant, the MySQL is part of the WAMP package. Thank you. 回答1: Add this to your my.cnf file (or my.ini if you're using windows): sql_mode="TRADITIONAL" and restart the server 回答2: MySQL sql_mode