InMotion Hosting Support Center

If you want to change between databases in MariaDB using SSH, it will depend on the user name that you're using when you're logged into the command line. The following tutorial will show you how to change the database in command line. Note that some user names may be assigned to multiple databases.

  1. Login to SSH.
  2. Login to MySQL (MariaDB) using the database user that you know is assigned to the database you're trying to view. Use the following command:

    MariaDB [(none)]> mysql -u username -p

    You will notice the following screen if you successfully login. Note that you can see that you're using MariaDB at this point.

    Login to the mysql command line
  3. If you don't know what databases are assigned to the user that you selected, then you can view the databases that have been assigned to that user..

    MariaDB [(none)]> show databases;

    You will see a list of databases assigned to that user.

    show the databases assigned to the user
  4. You will need to select the database by using the following command:

    MariaDB [(none)]> use databasename;

    Select the database you want to see

At this point you will be working with the database that you have selected based on the user name you are using. If you want to change databases, you may need to change databases. You can use the exit command to logout. Or if you can use the same user name, you can repeate the use command to select a different database.

Was this article helpful?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!