Solved

db2 connect on mac

Posted on 2014-12-27
3
621 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 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

707 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