Connecting to the database

Modified on Thu, 17 Feb, 2022 at 2:13 PM

At Savvii you can connect to the database of your site(s) in several ways, namely:


  • Using phpMyAdmin
  • Using external software (HeidiSQL, Sequel Pro, MySQL Workbench, etcetera)


In this article we show you how this works. There are small differences between VPS and Shared packages in the login process, so it is important to first determine whether the site whose database you want to access is on a VPS or Shared package. This information can be found on admin.savvii.com.


Login to PHPMyAdmin (VPS package)


If you have a VPS package at Savvii, PHPMyAdmin is disabled by default. You can enable PHPMyAdmin on admin.savvii.com by navigating to the administration of the package for which you want to enable PHPMyAdmin and clicking on the "Database" tab. On this page you will see the possibility to enable PHPMyAdmin. Enabling PHPMyAdmin on a VPS is done at server level. This means that if you have a VPS Ten (or higher), you can access all databases in that package via PHPMyAdmin. It is not possible to enable PHPMyAdmin selectively for certain sites within one package.


To log in to PHPMyAdmin you will first need to navigate to the PHPMyAdmin site for your package. The link can be found on admin.savvii.com under the tab "Database". The link will look something like this:

https://server.savviihq.com/savvii-pma/
HTML


You'll have to fill in two details:

  • Username
  • Password


The data to log into your database can be found by connecting to your site with sFTP and viewing the database.cnf file, which can be found on the following path:

/var/www/systeemnaam/config/database.cnf
Text


Tip: it is also possible to find the login details for your database in wp-config.php, however, these credentials may be incorrect if, for example, you have just moved the site to us. It is therefore safer to keep database.cnf as leading.


The content of the file will look something like this:

[client]
host=127.0.0.1
user=gebruikers-naam
password="120f04fe8bc8a"
HTML


The username is everything after "user=" and the password is everything after "password=". Don't forget to remove the surrounding quotes from the password, they are not part of the password.


To disable PHPMyAdmin for your package you need to contact support.


Login to PHPMyAdmin (Shared package)


If you have a Shared package with Savvii, PHPMyAdmin is already enabled by default. At admin.savvii.com, under the tab "Database", you can either follow the link to PHPMyAdmin or follow this direct link. You will need to fill in three details:

  • Username
  • Password
  • Database server


The data to log into your database can be found by connecting to your site with sFTP and viewing the database.cnf file, which can be found on the following path:

/var/www/systeemnaam/config/database.cnf
Text


Tip: it is also possible to find the login details for your database in wp-config.php, however, these credentials may be incorrect if, for example, you have just moved the site to us. It is therefore safer to keep database.cnf as leading.


The content of the file will look something like this:

[client]
host=127.0.0.1
user=gebruikers-naam
password="120f04fe8bc8a"
HTML


What is behind host= is the name of the database server we have to select in the dropdown menu. On shared packages the database for the site is not on the same server as the site itself but on a specially configured database server. We also enter the username (all behind user=) and the password (all behind password=). Attention! The password must be entered without the surrounding quotes. In the example above, the password is what needs to be entered:

120f04fe8bc8a
HTML

If you have entered your details correctly, you can connect to PHPMyAdmin.


Connect using external software

/var/www/systeemnaam/config/database.cnf
Text


With a VPS, the file will look something like this, change host to <username>:

[client]
host=127.0.0.1
user=gebruikers-naam
password="120f04fe8bc8a"
HTML

You can directly copy the username and password (password without surrounding quotes) but the host can't copy you directly. The IP address 127.0.0.1 indicates that the database is on the server where the database.cnf file is located. However, if you connect from the outside, 127.0.0.1 would point to your own device, which is not where the database is located. You will need to enter the *.savviihq.com address name you have been assigned by us, for example: nlmatt-giserenda.savviihq.com. Another option is to enter the server's IP address, which you can find by logging into admin.savvii.com and navigating to the DNS tab.


With a Shared package you can not use external software to connect to the database.


Connecting using SSH tunnelling (advanced)


If you have SSH access to your server enabled on admin.savvii.com it is possible to connect to the database using SSH tunnelling. This has the advantage that you are not tied to IP whitelisting and thus, as long as you have your SSH credentials available, are able to connect to the database from any network.


How you can set up SSH tunnelling differs per software package. For this reason, we cannot give you an unambiguous answer as to how exactly you should set this up for your software. However, you will need at least the following information:

  • SSH username (found at admin.savvii.com)
  • SSH password (reset to admin.savvii.com)
  • Hostname of the database (see database.cnf)
  • User name of the database (see database.cnf)
  • Password of the database. (See database.cnf)
  • SSH Gate (22)
  • MySQL Port (3306)

Note: it is possible that your software will ask for the SSH password first and then for the MySQL password. These are other passwords. So pay attention to which passwords you enter in which order.


Almost all software that supports SSH tunnelling also allows you to use an SSH key instead of an SSH password. You can use a support ticket to add your public SSH key to the server so you can use this feature.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article