Cannot connect to Mysql through /tmp/mysql.sock. The reason is that this socket does not exist. Two versions of mysql are installed, one is 5.7, socket: /tmp/mysql-5.7.sock and one 5.5, socket: /tmp/mysql-generic -5.5.sock. Just specify the socket connection in the following way.
mysql –socket=/tmp/mysql-5.7.sock -u databaseuser -p