Solved

db2 connect on mac

Posted on 2014-12-27
3
477 Views
Last Modified: 2014-12-27
I installed db2 express on mac, but how to connect to a remote database, i can't find db2connect command like on windows
0
Comment
Question by:sniger
  • 2
3 Comments
 
LVL 18

Expert Comment

by:SimonAdept
ID: 40520013
Did you read the Network Access section of the installation guide?

Access the database via the Terminal application.

Create the sample database:
>db2sampl

Start it up (assuming db2inst1 is the db2 user):
>sudo -u db2inst1 db2start

Test it:
>db2 connect to SAMPLE
>db2 list tables

YMMV depending on your OS X version. Seems that people have had difficulties installing on recent versions such Mavericks or Yosemite.
0
 

Author Comment

by:sniger
ID: 40520041
I'm reading this ,

when I tried to create an instance:   sudo ./db2icrt -u db2inst1 db2inst1
I got an error:  " The host name "server.local" is invalid. Specify a valid host name"

besides do you need to have a special db2 command interpreter to call "db2 connect" ?  Where is this command available ?
0
 
LVL 18

Accepted Solution

by:
SimonAdept earned 500 total points
ID: 40520044
Try typing this in Terminal (as root):
echo "127.0.0.1 $HOSTNAME" >>/etc/hosts

You should be able to use the db2 connect command from the Terminal command line.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now