List:General Discussion« Previous MessageNext Message »
From:Srini Bhamidipaty Date:April 9 1999 3:49pm
Subject:RE: How to switch users.
View as plain text  
Hi Fred,
I got connect to mysql  as a root user at localhost  and I want to switch
the  user to user1 at localhost.
I have used mysql_connect() and also mysql_real_connect().
The commands I have used at mysql> prompt and the corresponding errors are
given below :


[sbhamidi@darkness bin]$ ./mysql -u root -p mysql
Enter password:


Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 3.22.19

Type 'help' for help.

mysql>

Mysql> mysql_real_connect(host localhost,user user1,passwd);
ERROR 1064: You have an error in your SQL syntax near
'mysql_real_connect(host localhost,user mali,passwd)' at line 1

Mysql> mysql _connect(host localhost,user user1,passwd);
ERROR 1064: You have an error in your SQL syntax near 'mysql_connect(host
localhost,user user1,passwd)' at line 1

If I am wrong in supplying the arguments please help me.
Thanks.
Srini



-----Original Message-----
From:	Fred Lindberg [mailto:lindberg@stripped]
Sent:	Friday, April 09, 1999 9:52 AM
To:	mysql@stripped
Subject:	Re: How to switch users.

On Fri, 9 Apr 1999 09:51:13 -0500, Srini Bhamidipaty wrote:

>I have gone through the manual and I could find only how to connect from a
>shell prompt.

Where _do_ you want to connect from?

mysql_connect() takes a user arg (as well as the DBD/DBI functions),
mysql from the command line takes -u user, ODBC takes a user argument
...

-Sincerely, Fred

(Frederik Lindberg, Infectious Diseases, WashU, St. Louis, MO, USA)



---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail mysql-thread1587@stripped

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail mysql-unsubscribe@stripped instead.

Thread
How to switch users.Srini Bhamidipaty9 Apr
  • Re: Problem connecting to db in MySql from Java codeDavid Halsted15 Sep
Re: How to switch users.Fred Lindberg9 Apr
  • RE: How to switch users.Srini Bhamidipaty9 Apr
RE: How to switch users.Fred Lindberg9 Apr
  • Creating a SQL script to generate tables.Srini Bhamidipaty9 Apr
    • RE: Creating a SQL script to generate tables.Jay Miller9 Apr
      • RE: Creating a SQL script to generate tables.Srini Bhamidipaty9 Apr
        • Re: Creating a SQL script to generate tables.Thimble Smith9 Apr
Re: Creating a SQL script to generate tables.Fred Lindberg9 Apr
  • FAQ vs Manual (was: Re: Creating a SQL script...)S. Whitmore10 Apr
Re: FAQ vs Manual (was: Re: Creating a SQL script...)Fred Lindberg10 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Ed Carp11 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Michael Widenius11 Apr
    • Re: FAQ vs ManualPeter F. Brown11 Apr
      • Re: FAQ vs Manualjonathan michaels11 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Ed Carp11 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)kalle volkov11 Apr
    • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Steve Edberg11 Apr
      • Re: FAQ vs ManualPaul DuBois11 Apr
        • Re: FAQ vs ManualIsabelle Poueriet18 Apr
  • Re: FAQ vs ManualEd Carp11 Apr
    • Re: FAQ vs ManualPaul DuBois11 Apr
    • Re: FAQ vs Manualjonathan michaels12 Apr
      • Re: FAQ vs ManualPaul DuBois12 Apr
  • Re: FAQ vs ManualEd Carp11 Apr
  • Re: FAQ vs ManualEd Carp12 Apr
    • Re: FAQ vs ManualIsabelle Poueriet18 Apr
  • Re: FAQ vs ManualFred Read12 Apr
    • Re: FAQ vs Manualjonathan michaels13 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Fred Read12 Apr
    • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Isabelle Poueriet18 Apr
  • Re: FAQ vs ManualRichard Reina13 Apr
  • Re: FAQ vs ManualFred Read13 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Ed Carp13 Apr
    • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Vivek Khera14 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Fred Read13 Apr
    • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Micheal Mc Evoy13 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Ed Carp13 Apr
  • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Ed Carp14 Apr
    • Re: FAQ vs Manual (was: Re: Creating a SQL script...)jonathan michaels15 Apr
      • Re: FAQ vs Manual (was: Re: Creating a SQL script...)Darrell Shifflett15 Apr
Re: FAQ vs Manual (was: Re: Creating a SQL script...)Fred Lindberg12 Apr
  • More about my FAQ...S. Whitmore13 Apr
    • Re: More about my FAQ...Fred Read13 Apr
    • Re: More about my FAQ...Ed Carp13 Apr
Re: FAQ vs Manualluuk13 Apr