Multiple versions of mysql / mariadb
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".