Solved

db2 connect on mac

Posted on 2014-12-27
3
495 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:Simon
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:
Simon 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

16 Experts available now in Live!

Get 1:1 Help Now