0

I have cat orthomcl/Dockerfile:

FROM debian:stretch-backports

RUN apt-get update  && apt-get install -y --no-install-recommends \
        wget \
        cpanminus \
        build-essential \
        default-libmysqlclient-dev \
        python \
        ca-certificates \
        && rm -rf /var/lib/apt/lists/*

RUN mkdir diamond \
        && cd diamond \
        && wget -c https://github.com/bbuchfink/diamond/releases/download/v0.9.14/diamond-linux64.tar.gz \
        && tar xvf diamond-linux64.tar.gz \
        && rm *.tar.gz

RUN cpanm DBI DBD::mysql
RUN wget -c https://www.micans.org/mcl/src/mcl-latest.tar.gz
RUN tar xvf mcl-latest.tar.gz
RUN cd mcl-* && ./configure && make && make install
RUN wget -c https://orthomcl.org/common/downloads/software/v2.0/orthomclSoftware-v2.0.9.tar.gz
RUN tar xvf orthomclSoftware-v2.0.9.tar.gz

ENV PATH="/diamond:/orthomclSoftware-v2.0.9/bin:${PATH}"

This is my docker-compose.yml:

orthomcl:
    tty: true
    build: orthomcl
    restart: always
    links:
        - db
    volumes:
        - ./output_dir/:/output_dir

db:
  image: mariadb
  restart: always
  environment:
    - MYSQL_ROOT_PASSWORD="PAssw0rd"
    - MYSQL_DATABASE="orthomcl"
    - MYSQL_USER="orthomcl"
    - MYSQL_PASSWORD="PAssw0rd"
  ports:
    - "3306:3306"
  volumes:
    - ./mysql/:/docker-entrypoint-initdb.d

This is the SQL config file:

$ cat mysql/orthomcl.sql 
CREATE DATABASE IF NOT EXISTS `orthomcl`;
create user `orthomcl`@`db` identified by 'PAssw0rd';
GRANT ALL PRIVILEGES on `orthomcl`.* to `orthomcl`@`db`;

This is the App config file:

$ cat output_dir/orthomcl.cnf 
dbVendor=mysql
dbConnectString=dbi:mysql:database=orthomcl;host=db;mysql_local_infile=1
dbLogin=orthomcl
dbPassword=PAssw0rd
similarSequencesTable=SimilarSequences
orthologTable=Ortholog
inParalogTable=InParalog
coOrthologTable=CoOrtholog
interTaxonMatchView=InterTaxonMatch
percentMatchCutoff=50
evalueExponentCutoff=-5
oracleIndexTblSpc=NONE

Next, I used docker-compose up and after it I did:

$ docker-compose run orthomcl orthomclInstallSchema /output_dir/orthomcl.cnf orthomclInstallSchema_sql.log 
Starting orthomcl_db_1 ... done
DBI connect('orthomcl:db:mysql_local_infile=1','orthomcl',...) failed: Access denied for user 'orthomcl'@'172.17.0.4' (using password: YES) at /orthomclSoftware-v2.0.9/bin/../lib/perl/OrthoMCLEngine/Main/Base.pm line 56.

MySQL logs shoows:

...
db_1        | 2019-05-03  3:40:06 0 [Note] mysqld: ready for connections.
db_1        | Version: '10.3.14-MariaDB-1:10.3.14+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
db_1        | 2019-05-03  3:40:18 8 [Warning] Access denied for user 'orthomcl'@'172.17.0.4' (using password: YES)

How is it possible to solve the above error?

Thank you in advance.

user977828
  • 205
  • 4
  • 15
  • Looks like you forgot to configure your application. – Michael Hampton May 03 '19 at 01:23
  • I added `mysql/orthomcl.sql ` and updated `output_dir/orthomcl.cnf ` in my question above but unfortunately, there is still the same error. Any idea what could be wrong? – user977828 May 03 '19 at 03:06
  • I don't see the hostname in your database connection string. So it's trying to connect to localhost. That's obviously wrong. It must be connecting to `db` instead because that's the name you gave your MySQL container. – Michael Hampton May 03 '19 at 03:08
  • I changed it to `grant SELECT, INSERT, UPDATE, DELETE, CREATE VIEW, CREATE, INDEX, DROP on `orthomcl`.* to `orthomcl`@db;` but still no luck. Have I to change `dbConnectString=dbi:mysql:orthomcl:mysql_local_infile=1`? – user977828 May 03 '19 at 03:14
  • Yes, you have to change it! That is what I said before. Of course we have no way to know what you need to change it to. I don't recognize any format in that connection string. Try looking at the documentation for your application. – Michael Hampton May 03 '19 at 03:18
  • I changed `mysql/orthomcl.sql`, `output_dir/orthomcl.cnf ` and Mariadb in my above question but now it shows `Access denied for user 'orthomcl'@'172.17.0.4'`. What else could I miss? – user977828 May 03 '19 at 03:47
  • I updated my question above to reflect all file changes which I did except `orthomcl/Dockerfile` but still no luck. What else could I miss? – user977828 May 03 '19 at 05:24
  • Can you try **FLUSH PRIVILEGES;**, if still not work give access to all host just to check, later you can change. – asktyagi May 06 '19 at 01:59

0 Answers0