The mysql software may be used to connect to MySQL from the command line, as explained in this article. To quickly and easily access your databases directly, you can utilize the MySQL software.
Use these procedures to establish a command-line connection to MySQL:
Use SSH to access your hostingws account.
mysql -u username -p```
- Enter your password at the Enter Password screen. The mysql> prompt shows up after you enter the right password.
- Enter the following command at the mysql> prompt to see a list of databases:
show databases;```
use dbname;```
- list text hereSQL queries, list tables, and other operations can be performed after gaining access to a database. Furthermore:
- Enter help at the mysql> prompt to see a list of MySQL commands.
- Enter \q at the mysql> prompt to end the mysql program.
When you run a command at the mysql> prompt you may receive a warning message if
MySQL encounters a problem. For example, you may run a query and receive a message
that resembles the following:
Query 0K, e rows affected, 1 warning (0.04 sec).
To view the complete warning message, type the following command: ```
SHOW WARNINGS;```
### Additional Information
- The mysql command line application may be found at [http://dev.mysql.com/doc/refman/5.1/en/mysql.html](http://http://dev.mysql.com/doc/refman/5.1/en/mysql.html).