1. Home
  2. Hosting and Web
  3. Databases
  4. Connecting to the database via console
  1. Home
  2. Cloud and Servers
  3. Virtual Servers (VPS)
  4. Connecting to the database via console

Connecting to the database via console

In order to manage databases via console a database server administrator is usually used – root user.

Note! This access is different from root password to VPS, database server has its own user system.

For VPS purchased with ServerManager service you can find password in file /root/.mysqlpass . Connection is possible via a command:

mysql -uroot -p`cat /root/.mysqlpass`

ServerManager requires for correct database management the password to be written in this file. Do not forget to change the password in the file if you have changed it.

If you are not using ServerManager, you need to set a new password for a root user before connecting. You can set the password via command:

mysqladmin password

After entering and repeating the password you can log in:

mysql -uroot -pYOURPASSWORD
Updated on October 3, 2024

Was this article helpful?

Related Articles