Hi.

On Sat, Feb 16, 2002 at 07:47:57AM +0100, [EMAIL PROTECTED] wrote:
> Hi mysql list members,
> 
> Meanwhile I am pretty sure that this strange behaviour is a bug. But
> obviously I am blind. Where can mysql bugs be reportet?

http://www.mysql.com/doc/B/u/Bug_reports.html

> The strange behaviour is (I asked about it yestereday):
> 
> We use the following statements to setup users and rigts for a mysql
> server which is accessible locally and via internet:
> 
> INSERT INTO mysql.user VALUES 
> ('%','xyz00',PASSWORD('...'),
>  'N','N','N','N','N','N','N','N','N','N','N','N','N','N');
> 
> INSERT INTO mysql.db VALUES
> ('%','xyz00_%','xyz00','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');

Has the second line anything to do with the behaviour? It shouldn't as
you use "xyz00" below and user field will match only the user name
'xyz00_%'.

Note that '_' and '%' have no special meaning within the user field -
to mean any user, use an empty user field. But the line wouldn't affect
xyz00 even if '_%' had a special meaning. For further details, see
http://www.mysql.com/doc/C/o/Connection_access.html.

> The server runs on 66.70.34.150:3307. We can connect via socket locally
> and via Host:Port remote:

Well, I inserted both lines above into my system (not giving any
privileges, but that doesn't matter, because it fails for you, before
any privileges are evaluated):

local> mysqldump -t mysql user -w "user like 'xyz%'"
# MySQL dump 8.16
#
# Host: localhost    Database: mysql
#--------------------------------------------------------
# Server version        3.23.46-log

#
# Dumping data for table 'user'
# WHERE:  user like 'xyz%'
#

INSERT INTO user VALUES 
('%','xyz00','446a12100c856ce9','N','N','N','N','N','N','N','N','N','N','N','N','N','N');
INSERT INTO user VALUES 
('%','xyz00_%','446a12100c856ce9','N','N','N','N','N','N','N','N','N','N','N','N','N','N');

>       remote-system> mysql -h 66.70.34.150 -P 3307 -u xyz00 -p
>       => works

remote> mysql -h192.168.121.34 -uxyz00 -p1234 -e 'select user()'
+----------------------+
| user()               |
+----------------------+
| [EMAIL PROTECTED] |
+----------------------+

>       local-system> mysql -S /var/run/mysql-ext/mysql.sock -u yxz00 -p
>       => works

local> mysql -hlocalhost -uxyz00 -p1234 -e 'select user()'
+-----------------+
| user()          |
+-----------------+
| xyz00@localhost |
+-----------------+

> But we can NOT connect locally by host:port:
> 
>       local-system> mysql -h 66.70.34.150 -P 3307 -u xyz00 -p
>       => ERROR 1045: Access denied for user: 'xyz00@localhost' 
>               (Using password: YES)

local> mysql -h192.168.121.34 -uxyz00 -p1234 -e 'select user()'
+----------------------+
| user()               |
+----------------------+
| [EMAIL PROTECTED] |
+----------------------+

It works fine for me, you see? And no, I have not any other entry in
the privilege tables, that would allow user xyz00@localhost to
connect. After I delete the two rows, I get:

local> > mysql -h192.168.121.34 -uxyz00 -p1234 -e 'select user()'
ERROR 1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: YES)


The interesting part is, why does it display for you xyz00@localhost,
whilst it displays an IP for me? Are you sure you copied the correct
error message? If so, my first guess would be that your hosts config
is mixed up a bit.

Anyhow, "xyz00@localhost" should match the first of the both lines
in the user table.

> On a mysqld which is accessible only locally the both INSERT statements
> above would have  "localhost" instead of "%". The bug is, in my opionon,
> that "localhost" does not qualify for "%"?

It should qualify and it does for me.

> Doubling the user entries is not a good solution, by my opionon,
> because it means that we have to maintain double rights and
> passwords.

But only in the user table. You can use the hosts table to tell MySQL
that two (or more) host should be viewed as a group and avoid doubling
entries in the other ones this way.

> Ok, is there a bugreport possibility for mysql?

Normally, you would use mysqlbug for this, which should have come with
your MySQL installation.

Bye,

        Benjamin.

-- 
[EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to