I think I'd probably set up aliases that invoke mysql or mysqladmin
with a --defaults-extra-file option that contains the username/password
for the appropriate account.



At 16:39 -0600 10/2/05, s. keeling wrote:
I've checked everywhere I can find (Paul DuBois' MySQL, ML archives,
dev.mysql.com, my local User Group) for this, but everything I find
either describes a simplistic or far more complex case.  This is all
on my local box, no networking required, and I'm the only one
accessing the data.  I've four MySQL related accounts: root, admin,
keeling, and sbk.  root is the root mysql user (which I'd prefer to
leave alone once the rest is working, which it mostly is).  admin is
just for trivial mysqladmin stuff.  keeling is a full blown admin
account able to create and drop db's.  sbk is a user account intended
for entering/changing/querying data.

So, I'd like (ie.) this ~/.my.cnf to control my login account access
to the db:

  -----------------------
[client]
user            = sbk       # <-- user use of mysql related clients
password        = ...

[mysql]
user            = keeling   # <-- admin use of mysql-client
password        = ...

user            = sbk       # <-- user use of mysql-client
password        = ...

[mysqladmin]
user            = keeling
password        = ...

[mysqladmin]
user            = admin
password        =
  -----------------------

Of course, it's been chmodded 600.

Infuriatingly, no matter how many iterations of massaging this, when
it works for sbk it's broken for keeling, and vice versa:

(0) infidel /home/keeling/devl/perl/cuug_ mysql -u keeling
ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)

The admin account, with no password, doesn't function at all.  perl
programs appear to ignore ~/.my.cnf forcing me to open() them and
slurp username and password that way.

How is this supposed to work?  Surely, you're not all embedding
passwords in your source, are you?  How can I have separate user and
admin accounts working via ~/.my.cnf from the same login account?

This is MySQL 4.0 on Debian/Gnu Linux (Testing/Etch) (note the
"anonymous user" accounts have had their passwords changed, if they
exist at all; I'm not sure about that latter bit).  Yes, there are
more recent MySQL versions available in the repositories, but I don't
need bleeding edge features.  I just need base functionality.

Please point me at FAQs or websites that explain this better than
those I've seen so far.  Thanks.  Much appreciated.


--
Any technology distinguishable from magic is insufficiently advanced.
(*)               http://www.spots.ab.ca/~keeling
- -

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to