the file existed but it was not including the DB1_PORT var.
the problem started from the fact that the mysql cli was not reading the db name at the end of the command, although the var contained the correct value.
These are the packages I have related to mysql:
# dpkg -l|grep mysql
ii libdbd-mysql-perl 4.033-1ubuntu0.1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient20:amd64 5.7.21-0ubuntu0.16.04.1 amd64 MySQL database client library
ii mysql-common 5.7.21-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii percona-server-common-5.5 5.5.59-rel38.11-1.xenial amd64 Percona Server database common files (e.g. /etc/mysql/my.cnf)
ii php-mysql 1:7.0+35ubuntu6 all MySQL module for PHP [default]
ii php7.0-mysql 7.0.25-0ubuntu0.16.04.1 amd64 MySQL module for PHP