unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: rb <rb@panix.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: sql-mode password display
Date: 03 Mar 2005 18:15:29 -0500	[thread overview]
Message-ID: <kx9ekewpbhq.fsf@panix5.panix.com> (raw)
In-Reply-To: <mailman.2522.1109885280.32256.help-gnu-emacs@gnu.org>

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
-- 

      parent reply	other threads:[~2005-03-03 23:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-02 16:57 sql-mode password display rb
2005-03-02 18:31 ` Kevin Rodgers
2005-03-02 20:35   ` rb
2005-03-03 19:42     ` Kevin Rodgers
2005-03-03 20:51 ` Michael Mauger
     [not found] ` <mailman.2522.1109885280.32256.help-gnu-emacs@gnu.org>
2005-03-03 23:15   ` rb [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=kx9ekewpbhq.fsf@panix5.panix.com \
    --to=rb@panix.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).