Assuming that the server allows remote access, from Mysql.com: MySQL :: MySQL 5.0 Reference Manual :: 4.2.2 Connecting to the MySQL Server, run this command:
mysql --host=<mysql_server_ip_address> --user=<mysql_username> --password <mysql_database_name>
If the server doesn't use the default MySQL
port (3306
), append the --port
argument to the command:
mysql --host=<mysql_server_ip_address> --port=<mysql_server_port> --user=<mysql_username> --password <mysql_database_name>
Then enter your password and press Enter.
On a side note, you could even append the password directly to the command by using --password=<mysql_password>
instead of --password
, altough users on your system would be able to see it by running ps auxw
, so see for yourself which method suits the most.