How to connect to MySQL from the command line. Log in to your A2 Hosting account using SSH. At the command line, type the following command, replacing USERNAME with your username: mysql -u USERNAME -p. At the Enter Password prompt, type your password. To display a list of databases, type the following command at the.