Thursday, July 14, 2011

CONNECTING TO MYSQL AS DIFFERENT USER

I have installed mysql in my system and created a new user using create user command.

Although I can login as this new user through gui in mysql but how can I login as this new user through sqlclient command line.

It is to simple although you can't do that directly through menu->mysql5.0>sqlcommandlineclient

for this to happen go to command prompt

I.e run>cmd

go to the path of bin directory where mysql is installed in your system

as cd C:\Program Files\MySQL\MySQL Server 5.0\bin in my system

type mysql -h 'hostname where server is running not yourhostname as to connect to 14 server i will use 192.168.1.14' -p -u 'yourusername' press enter

it will ask for your password provide that. You are done.

No comments:

Post a Comment