Multiple versions of mysql / mariadb I am running 10.3.18-MariaDB-log MariaDB Server but for one application it require I run mysql 5.7, so I am installed that to run under another port which works fine. 

However for the software that requires mysql 5.7 I cannot seem to pass this as my mysql client version still shows up as mariadb's 5.5 mysql client. 

This is my.cnf for the mysql 5.7 version

[mysql]

# CLIENT #
port                           = 3307
socket                         = /var/lib/mysql2/mysql2.sock


[mysqld]
port = 3307
socket                         = /var/lib/mysql2/mysql2.sock
datadir = /var/lib/mysql2
pid-file=/var/lib/mysql2/mysqld2.pid


is there someway to specify what mysql client binary I can run ? I am not sure what I am doing wrong?

/usr/local/mysql2/bin/mysql -V
/usr/local/mysql2/bin/mysql  Ver 14.14 Distrib 5.7.27, for Linux (x86_64) using  EditLine wrapper

/usr/local/mysql2/bin/mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 99552
Server version: 5.5.5-10.3.18-MariaDB-log MariaDB Server
When you run /usr/local/mysql2/bin/mysql in your last code snippet, that is obviously your MySQL 5.7 mysql command-line client, but the output shows it's connecting to your MariaDB server:

Server version: 5.5.5-10.3.18-MariaDB-log MariaDB Server


If you want it to connect to your MySQL 5.7 server, then you need to specify the non-default port or socket and maybe other credentials like the database user and password (if you have created that), e.g. one of these commands:

/usr/local/mysql2/bin/mysql -P3307
/usr/local/mysql2/bin/mysql -uroot -p -P3307
/usr/local/mysql2/bin/mysql -S/var/lib/mysql2/mysql2.sock


For reference, see also my answer to "how to install a second server of mariadb".