[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sql-completion.el messing with sql-mysql?
From: |
Frank Stutzman |
Subject: |
Re: sql-completion.el messing with sql-mysql? |
Date: |
Thu, 20 Feb 2014 16:10:42 +0000 (UTC) |
User-agent: |
tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/9.2-RELEASE-p3 (amd64)) |
Chris Van Dusen <cavandusen@gmail.com> wrote:
>
> I believe this is because sql-completion.el assumes that MySQL is running on
> localhost. See the function mysql-shell-query.
Thanks Chris, this looksl like the right path although mysql-shell-query
is defined in mysql.el. Here is that function in entirity:
;;; query with shell command
(defun mysql-shell-query (sql &optional db)
(let ((cmd (mapconcat
'identity
(append (append (list mysql-program)
;; -s option inhibit header in output
(remove "-s" mysql-options))
(list
"-u" mysql-user
db
(and (string< "" mysql-password)
(concat "-p" mysql-password))
"-e" (format "\"%s\"" sql)))
" ")))
(mysql-output-table (shell-command-to-string cmd))))
Staring at this long enough has me convinced that what it is feeding to
the mysql client is missing a '-h server_name' when it is needed. The server
name seems to be kept in the sql-mysql-login-params variable, although I am
unclear how to extract it from the other parameters.
In further poking about, it seems to me that mysql.el just isn't set up to
handle a remote database at all. For example, the mysql-connect fuction
is also missing any reference to a server.
I think fixing this is beyond my limited skills. For my needs, I am going to
have to abandon the idea of have completion available for my mysql development.
--
Frank Stutzman