0

Welcome

Sign in

Knowledge Base

HomepageKnowledge BaseServer/VPSHow to connect to MySQL from the co...

How to connect to MySQL from the command line

MySQL is a popular database management system that powers a large portion of the web. Databases stored on BengalCloud VPS servers can be managed using interfaces such as phpMyAdmin or using MySQL instructions entered into a command line window.

To connect to MySQL from the command line, you will first need to log in to your server via SSH. Follow the instructions presented in this BengalCloud knowledge base document to log in to your server via SSH: How to connect to your server via Secure Shell (SSH).

SSH login

Once you’re logged in to your server, enter the following command, replacing [username] with your user name:

mysql -u [username] -p

MySQL login

Enter your password to proceed.

MySQL logged in

Note: if you wish to use the MySQL root account, you will need to change the password from the default, random root password created when your server is commissioned. To do so, log in to your server’s WHM dashboard and type “mysql” in the search bar, then select MySQL Root Password.

How to connect to MySQL from the command line

Create a new, strong password, then click Change Password to proceed.

Connect to MySQL from the command line

You can now manage the databases stored on your server using the command line. To view a list of MySQL commands, type help. You can also refer to the following support document for more information about the MySQL command line: https://dev.mysql.com/doc/refman/5.7/en/mysql.html

When you wish to exit the MySQL command line, enter \q.

Quit MySQL

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(31 times viewed / 0 people found it helpful)
© 2026 BengalCloud. A brand of Zorn Ventures Limited. All rights reserved.
Top