Re: command mysql -u $user without typing it - getting shafted and annoyed now.

2002-01-16 Thread Gerald Clark

How did you add the users?
If you inserted them into the user table, you are asking for trouble 
unless you
understand exactly what you are doing. That is why the GRANT and REVOKE
statements were added.
Since you did not use 'identified by somepassword'
I'm not sure if you set one, in which case the -p option would cause a 
failure.

Also, even though the manual states that you don't need to FLUSH PRIVILEGES
after using GRANT, I find that sometimes I do.

Matthew Darcy wrote:

I must be going so wrong here.

I deleted the users and started again.

added 2 users

dba and matt. Both of these have the host of % (connect from anything yes ?)

I then do a

grant all privileges on *.* to dba@%
flush privileges

and

grant all privileges on *.* to matt@%
flush privileges


then mysql -u matt -p
gives me ERROR 1045: Access denied for user: 'dba@localhost' (Using
password: YES)

and I am on the local host ???

what the hell is going on  I thougth I understood and was getting
somewhere.

obviously not.

Sorry to drag this up again.

Matt.




-Original Message-
From: Ho, Kam [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 16:10
To: '[EMAIL PROTECTED]'; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


Try this:

mysql grant all privileges on *.* to test2@localhost

also read manual about the grant command.

-Original Message-
From: Matthew Darcy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 11:04 AM
To: Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


I read similar notes on this in the manual, saying that invoking mysql
without the username will try to take the unix username if it exists in the
database.

I tried this with test2, it opened an mysql session no problem, but when I
did a connect mysql it said access is denyed for user @localhostto database
mysql

to me this looks like it is trying to connect with no user instead of
test2@localhost

can you explain this ?

Thanks,

Matt.


-Original Message-
From: Gerald Clark [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 15:56
To: [EMAIL PROTECTED]
Cc: MySql List
Subject: Re: command mysql -u $user without typing it 




Matthew Darcy wrote:

I have 3 UNIX users on my server.

test1, test2, and test3.

I have created 3 users for mysql test1, test2, and test3 (shock horror)

If I want to connect to the database as root then I understand I must do
mysql -u root -p

but I would like test1 2 and 3 to be able to type mysql and be either

logged

in as their unix username, ie test2 types mysql and connects to the

database

as test2 (mysql account)
or at least be prompted for the password for test2.

The only way I can think of doing this is by setting up an alias ie

alias mysql_connect=`mysql -u $username -p`

there must be some sort of autologin from username like in oracle.

Thanks,

Matt.

The user defaults to the unix user.
You can put a .my.cnf file in their home directory with

[client]
password=whatever

to make it even easier.


-
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


-
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

-
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





-
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




RE: command mysql -u $user without typing it - getting shafted and annoyed now.

2002-01-10 Thread Matthew Darcy

I must be going so wrong here.

I deleted the users and started again.

added 2 users

dba and matt. Both of these have the host of % (connect from anything yes ?)

I then do a

grant all privileges on *.* to dba@%
flush privileges

and

grant all privileges on *.* to matt@%
flush privileges


then mysql -u matt -p
gives me ERROR 1045: Access denied for user: 'dba@localhost' (Using
password: YES)

and I am on the local host ???

what the hell is going on  I thougth I understood and was getting
somewhere.

obviously not.

Sorry to drag this up again.

Matt.




-Original Message-
From: Ho, Kam [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 16:10
To: '[EMAIL PROTECTED]'; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


Try this:

mysql grant all privileges on *.* to test2@localhost

also read manual about the grant command.

-Original Message-
From: Matthew Darcy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 11:04 AM
To: Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


I read similar notes on this in the manual, saying that invoking mysql
without the username will try to take the unix username if it exists in the
database.

I tried this with test2, it opened an mysql session no problem, but when I
did a connect mysql it said access is denyed for user @localhostto database
mysql

to me this looks like it is trying to connect with no user instead of
test2@localhost

can you explain this ?

Thanks,

Matt.


-Original Message-
From: Gerald Clark [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 15:56
To: [EMAIL PROTECTED]
Cc: MySql List
Subject: Re: command mysql -u $user without typing it 




Matthew Darcy wrote:


I have 3 UNIX users on my server.

test1, test2, and test3.

I have created 3 users for mysql test1, test2, and test3 (shock horror)

If I want to connect to the database as root then I understand I must do
mysql -u root -p

but I would like test1 2 and 3 to be able to type mysql and be either
logged
in as their unix username, ie test2 types mysql and connects to the
database
as test2 (mysql account)
or at least be prompted for the password for test2.

The only way I can think of doing this is by setting up an alias ie

alias mysql_connect=`mysql -u $username -p`

there must be some sort of autologin from username like in oracle.

Thanks,

Matt.

The user defaults to the unix user.
You can put a .my.cnf file in their home directory with

[client]
password=whatever

to make it even easier.


-
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


-
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

-
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


-
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




RE: command mysql -u $user without typing it - getting shafted and annoyed now.

2002-01-10 Thread Quentin Bennett

Hi Again

I just did this to check what you did:
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=mercury -p mysql
Enter password: 

mysql grant all privileges on mysql.* to matt@%;
Query OK, 0 rows affected (0.05 sec)

mysql flush privileges;
Query OK, 0 rows affected (0.19 sec)

mysql quit
Bye
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=matt mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 353315 to server version: 3.23.40-log

mysql quit
Bye
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=matt -p mysql
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 353316 to server version: 3.23.40-log
mysql quit
Bye
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=matt -p  
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 353317 to server version: 3.23.40-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql quit
Bye

As you can see, it all works fine - when prompted for a password, just
pressing return lets me in.

Can you post the results of:

select user, name, host from user;

It may help.

Quentin

-Original Message-
From: Matthew Darcy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 January 2002 11:10 p.m.
To: Ho Kam; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it - getting shafted
and annoyed now.


I must be going so wrong here.

I deleted the users and started again.

added 2 users

dba and matt. Both of these have the host of % (connect from anything yes ?)

I then do a

grant all privileges on *.* to dba@%
flush privileges

and

grant all privileges on *.* to matt@%
flush privileges


then mysql -u matt -p
gives me ERROR 1045: Access denied for user: 'dba@localhost' (Using
password: YES)

and I am on the local host ???

what the hell is going on  I thougth I understood and was getting
somewhere.

obviously not.

Sorry to drag this up again.

Matt.




-Original Message-
From: Ho, Kam [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 16:10
To: '[EMAIL PROTECTED]'; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


Try this:

mysql grant all privileges on *.* to test2@localhost

also read manual about the grant command.

-Original Message-
From: Matthew Darcy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 11:04 AM
To: Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


I read similar notes on this in the manual, saying that invoking mysql
without the username will try to take the unix username if it exists in the
database.

I tried this with test2, it opened an mysql session no problem, but when I
did a connect mysql it said access is denyed for user @localhostto database
mysql

to me this looks like it is trying to connect with no user instead of
test2@localhost

can you explain this ?

Thanks,

Matt.


-Original Message-
From: Gerald Clark [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 15:56
To: [EMAIL PROTECTED]
Cc: MySql List
Subject: Re: command mysql -u $user without typing it 




Matthew Darcy wrote:


I have 3 UNIX users on my server.

test1, test2, and test3.

I have created 3 users for mysql test1, test2, and test3 (shock horror)

If I want to connect to the database as root then I understand I must do
mysql -u root -p

but I would like test1 2 and 3 to be able to type mysql and be either
logged
in as their unix username, ie test2 types mysql and connects to the
database
as test2 (mysql account)
or at least be prompted for the password for test2.

The only way I can think of doing this is by setting up an alias ie

alias mysql_connect=`mysql -u $username -p`

there must be some sort of autologin from username like in oracle.

Thanks,

Matt.

The user defaults to the unix user.
You can put a .my.cnf file in their home directory with

[client]
password=whatever

to make it even easier.


-
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


-
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

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

To request this thread, e

RE: command mysql -u $user without typing it - getting shafted and annoyed now.

2002-01-10 Thread Matthew Darcy

mail seemed to come through out of sink in a strange order.

I take it you got the message about grant not altering the db table.

Thanks for the help. I leant a lot.

Matt.


-Original Message-
From: Quentin Bennett [mailto:[EMAIL PROTECTED]]
Sent: 10 January 2002 19:32
To: '[EMAIL PROTECTED]'; Ho Kam; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it - getting shafted
and annoyed now.


Hi Again

I just did this to check what you did:
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=mercury -p mysql
Enter password:

mysql grant all privileges on mysql.* to matt@%;
Query OK, 0 rows affected (0.05 sec)

mysql flush privileges;
Query OK, 0 rows affected (0.19 sec)

mysql quit
Bye
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=matt mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 353315 to server version: 3.23.40-log

mysql quit
Bye
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=matt -p mysql
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 353316 to server version: 3.23.40-log
mysql quit
Bye
SKYROAD#mercury1:/mercury/home/quentin:mysql --user=matt -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 353317 to server version: 3.23.40-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql quit
Bye

As you can see, it all works fine - when prompted for a password, just
pressing return lets me in.

Can you post the results of:

select user, name, host from user;

It may help.

Quentin

-Original Message-
From: Matthew Darcy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 10 January 2002 11:10 p.m.
To: Ho Kam; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it - getting shafted
and annoyed now.


I must be going so wrong here.

I deleted the users and started again.

added 2 users

dba and matt. Both of these have the host of % (connect from anything yes ?)

I then do a

grant all privileges on *.* to dba@%
flush privileges

and

grant all privileges on *.* to matt@%
flush privileges


then mysql -u matt -p
gives me ERROR 1045: Access denied for user: 'dba@localhost' (Using
password: YES)

and I am on the local host ???

what the hell is going on  I thougth I understood and was getting
somewhere.

obviously not.

Sorry to drag this up again.

Matt.




-Original Message-
From: Ho, Kam [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 16:10
To: '[EMAIL PROTECTED]'; Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


Try this:

mysql grant all privileges on *.* to test2@localhost

also read manual about the grant command.

-Original Message-
From: Matthew Darcy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 11:04 AM
To: Gerald Clark
Cc: MySql List
Subject: RE: command mysql -u $user without typing it 


I read similar notes on this in the manual, saying that invoking mysql
without the username will try to take the unix username if it exists in the
database.

I tried this with test2, it opened an mysql session no problem, but when I
did a connect mysql it said access is denyed for user @localhostto database
mysql

to me this looks like it is trying to connect with no user instead of
test2@localhost

can you explain this ?

Thanks,

Matt.


-Original Message-
From: Gerald Clark [mailto:[EMAIL PROTECTED]]
Sent: 09 January 2002 15:56
To: [EMAIL PROTECTED]
Cc: MySql List
Subject: Re: command mysql -u $user without typing it 




Matthew Darcy wrote:


I have 3 UNIX users on my server.

test1, test2, and test3.

I have created 3 users for mysql test1, test2, and test3 (shock horror)

If I want to connect to the database as root then I understand I must do
mysql -u root -p

but I would like test1 2 and 3 to be able to type mysql and be either
logged
in as their unix username, ie test2 types mysql and connects to the
database
as test2 (mysql account)
or at least be prompted for the password for test2.

The only way I can think of doing this is by setting up an alias ie

alias mysql_connect=`mysql -u $username -p`

there must be some sort of autologin from username like in oracle.

Thanks,

Matt.

The user defaults to the unix user.
You can put a .my.cnf file in their home directory with

[client]
password=whatever

to make it even easier.


-
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


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