To connect to MySQL from the command line, There following steps will help you:
SSH Live Server
- Log in to your Hosting account using SSH.
- At the command line, type the following command, replace USERNAME with your username:
mysql -u USERNAME -p
- Hit the Enter it will as password prompt, type your password. When you type the correct password, the mysql> prompt arrives.
- To display a list of databases, type the following command at the mysql> prompt:
show databases;
- To access a specific database, type the following command at the mysql> prompt, replacing DBNAME with the database that you want to access:
- To access a specific database, type the following command at the mysql> use DBNAME;
use DBNAME;
It will show all the available database and you can use one of them look at the example below:
+-------------------------+
| Database |
+-------------------------+
| blog.welook.in |
| ci_tutorial |
| information_schema |
| multiple_checkbox_email |
| mysql |
| performance_schema |
| phpmyadmin |
| rathorji.in |
| test |
| tutorial |
| welook.in |
+-------------------------+
11 rows in set (0.001 sec)