List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:January 9 2002 3:56pm
Subject:Re: command mysql -u $user without typing it ????
View as plain text  

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.

Thread
command mysql -u $user without typing it ????Matthew Darcy9 Jan
  • Re: command mysql -u $user without typing it ????Gerald Clark9 Jan
    • RE: command mysql -u $user without typing it ????Matthew Darcy9 Jan
  • Re: command mysql -u $user without typing it ????Carl Troein9 Jan
RE: command mysql -u $user without typing it ????Kam Ho9 Jan
  • RE: command mysql -u $user without typing it ????Matthew Darcy9 Jan
  • RE: command mysql -u $user without typing it - getting shafted and annoyed now.Matthew Darcy10 Jan
    • Re: command mysql -u $user without typing it - getting shafted and annoyed now.Gerald Clark16 Jan
RE: command mysql -u $user without typing it ????Kam Ho9 Jan
  • RE: command mysql -u $user without typing it ????Matthew Darcy9 Jan
    • RE: command mysql -u $user without typing it ????James Montebello9 Jan
      • RE: command mysql -u $user without typing it ????Matthew Darcy9 Jan
        • RE: command mysql -u $user without typing it ????James Montebello9 Jan
          • RE: command mysql -u $user without typing it ????Matthew Darcy10 Jan
            • Re: command mysql -u $user without typing it ????Carl Troein10 Jan
              • RE: command mysql -u $user without typing it ????Matthew Darcy10 Jan
        • RE: command mysql -u $user without typing it ????Doug Thompson10 Jan
          • RE: command mysql -u $user without typing it ????Matthew Darcy10 Jan
RE: command mysql -u $user without typing it ????Kam Ho9 Jan
RE: command mysql -u $user without typing it ????Quentin Bennett9 Jan
RE: command mysql -u $user without typing it ????Quentin Bennett10 Jan
  • RE: command mysql -u $user without typing it ????Matthew Darcy10 Jan
RE: command mysql -u $user without typing it ????Kam Ho10 Jan
  • RE: command mysql -u $user without typing it SORTED THANKS ALL !!!!Matthew Darcy10 Jan
RE: command mysql -u $user without typing it - getting shafted and annoyed now.Quentin Bennett10 Jan
  • RE: command mysql -u $user without typing it - getting shafted and annoyed now.Matthew Darcy10 Jan