[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sql-mode password display
From: |
rb |
Subject: |
Re: sql-mode password display |
Date: |
03 Mar 2005 18:15:29 -0500 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
Michael Mauger <mmaug@yahoo.com> writes:
> rb writes:
> >
> > When I use sql mode:
> >
>
> I'm the current maintainer of sql-mode. I'll assume that you are using
> the latest version of sql.el (available at http://savannah.gnu.org/cgi-
> bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el). Prior versions were
> similar so most of this will apply.
I'm not sure of the version I have been using, it's byte-compiled as
part of my emacs distribution, but I downloaded the latest version per
your indications, and the problems persist.
[...]
> The alternative is to use the `--password' (or `-p') option without a
> value and allow `mysql' to prompt you for it. The current version
> omits the `--password' option entirely if `sql-password' is an empty
> string.
>
> Take a look at the function `sql-connect-mysql' (or `sql-mysql' in
> older versions). There is a chunk of code like this:
>
> (if (not (string= "" sql-password))
> (setq params (append (list (concat "--password=" sql-password))
> params)))
>
> Try changing it to:
>
> (if (not (string= "" sql-password))
> (setq params (append (list (concat "--password=" sql-password))
> params))
> (setq params (append '("--password") params)))
>
> and remove your sql-password customization. You will now be required
> to enter your password each time you start sql-mysql.
I modified the code per your instructions, but one thing which I may
have failed to make clear in my previous post is that I do (already)
enter the password each time I connect. I do not have the password
stored in my .emacs or any other location, and I don't have that
variable set normally.
I also may have not made clear that the password shows up in the
Customization buffer (or that varaiable is set) only once I have
started an sql-mysql session.
> I don't use mysql at all so I'm not sure if this is globally
> appropriate. Is it possible to connect to mysql without a password at
> all? Do we need to distinguish between prompt me for a password and
> there is no password?
It is possible to set mysql to accept connections without a password,
but it seems worse to allow universal access to the mysql server than to
allow for the possiblilty that someone could find my password.
[...]
> If you modify sql.el as described above, sql-interactive-mode should
> capture the password prompt and ask for your password in the minibuffer.
As I mentioned, that's how I do connect now.
[...]
> I hope this helps. Let me know how it turns out. If you have any other
> suggestions concerning mysql support please send them along.
Thank you very much for your help. As I said in my first post, I find
the sql mode and the interactive sql connection to be very, very useful,
so thank you for that.
rb
--