Support for All linux based

Install Homebrew (if you don't have it). open terminal on mac and type this command below:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then, install mysql-client:

brew install mysql-client

Then, add the mysql-clientbinary directory to your PATH:

echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile

Restart services php

brew services restart php

Finally, reload your bash profile:

source ~/.bash_profile

Let’s try remote mysql to server

mysql -h your_ip_server -u root -p