Connect to a different database server within command line utility


In sqlcmd, you can connect to a different server by this command:

:connect MyServer

The above command will attempt to use integrated / Windows Active Directory authentication. To use traditional Sql Server authentication, use this instead:

:connect MyServer -U MyLogin

You can do the same kind of thing in Oracle Sql Plus by using this command:

conn[ect] MyLogin@OracleSID

For mysql command line, use this:

connect -h MyServer -u MyLogin -p

That is assuming that you are allowed to login to the MySql server from whereever you are now.

, ,

One response to “Connect to a different database server within command line utility”

  1. Dear Haidong Ji,

    I was very interested to read of your positive experience with MUZZY through your blog. I’d very much like to speak to you to learn more.

    Could you kindly give me a call, or tell me a convenient time for me to reach you? My phone is 888-327-5923 x 20 eastern time. I’m Education Director for Early Advantage.

    Thanks so much. I am greatly looking forward to speaking with you.

    Lynn

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.