Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Can't connect to the docker instance from my data access library

    Posted Mon January 20, 2020 11:43 AM
    Hello!
    Not sure where my previous message went.
    Anyway, I have a big problem: I have a custom application and a custom DAL (= Data Access Library). 
    The library works very well with many other RDBMSes. 

    This is the command I send to turn the docker container on:
    docker run -itd --name mydb2 --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=<MyPW> -e DBNAME=testdb -v :"D:\DB2\ProgramData\IBM\DB2\DOCKER-INSTANCE":/database ibmcom/db2

    You might surmise that this command is eerily similar to the one in the docos, because it is! 
    When I try connecting, what I get is "USERNAME AND/OR PASSWORD INVALID", reason 24, SQL State 08001. 
    I am sure that the password is right (given that, you know, I copied it from the command!) so the problem must surely be in the username. 
    My assumption here would be that the username ought ti be "mydb2" but apparently it's not because if it were then it would be right. I did try db2admin but that didn't work either. 
    I wonder what I am missing.

    Any ideas?

    Thanks!

    A

    ------------------------------
    Andrea Raimondi
    ------------------------------

    #Db2


  • 2.  RE: Can't connect to the docker instance from my data access library

    Posted Tue January 21, 2020 09:13 AM
    The username is "db2inst1".

    "mydb2" is just the name of the docker container.
    If you do not assign a container name with the --name option, then the daemon generates a random string name for you. Defining a name can be a handy way to add meaning to a container. If you specify a name, you can use it when referencing the container within a Docker network. This works for both background and foreground Docker containers.


    ------------------------------
    Bryan Hamby
    ------------------------------



  • 3.  RE: Can't connect to the docker instance from my data access library

    Posted Wed January 22, 2020 08:51 AM
    Did you try setting the password DB2INST1_PASSWORD=<> in .env_list file or does the .env_list file have a different value for DB2INST1_PASSWORD ?

    ------------------------------
    RADHIKA V
    ------------------------------