?
Solved

db2 connect on mac

Posted on 2014-12-27
3
Medium Priority
?
655 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

Question has a verified solution.

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

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…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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