Adjusting Database Configuration


The majority of Web sites today makes use of a  MySQL database  for the (structured), storage and processing of data. 
To communicate with the database, there is a configuration file within your site the correct login information corresponding to the database must be set. It may also be that you, for example, after you have moved a website, the configuration file “update” with new login information. This guide will be discussed how the configuration files of the  most common CMSs  can adjust well.

MySQL data
Prior to all this, we find the correct data on MySQL, so we can use later. For this you in  DirectAdmin  login. There you can then to MySQL management, where an overview of your databases will be shown worden.Wanneer you click on the database, users with access to that database will be displayed.
If you like your user database (no longer) know the password, you can simply  change password  , click to select a new password.
Open a text editor and insert the newly retrieved data. (database name, database username, database password)

The systems we will specifically deal with the following:

  1. WordPress
  2. Magento 2
  3. Joomla

Every website you first go to  File  and then  /domains/  to arrive at the site files.
If you right configuration files  Edit  clicks and afterwards just under rooster on  Save , you have no further need additional programs for this.


The WordPress configuration file is directly in public_html. It is the file  wp-config.php .
You can set database information as follows in this file:

  • define ( ‘DB_NAME’, ‘ database name ‘);
  • define ( ‘DB_USER’, ‘ Database username ‘);
  • define ( ‘DB_PASSWORD’ ‘ database password ‘);
  • define ( ‘DB_HOST’, ‘localhost’);

In some cases there are additional data that have changed, but these are all defaults.
Allows your site will therefore normally (back) are active.

Magento 2

In magento 2, the configuration in the file  /app/etc/env.php . This will therefore have to adapt to your database data.
Magento has made very clear the file, so you actually see immediately which values have changed. These are:

  • ‘Host’ => ‘localhost’
  • ‘dbname’ => ‘ Database name ‘
  • ‘username’ => ‘ Database username ‘
  • ‘password’ => ‘ Database Password ‘

Then you can save the file env.php and probably will work immediately. If not, you will first have to clear the cache.
This can be done through  SSH , with two successive commands.
The commands must be run from the public_html and are:

php bin/magento cache:clean
php bin/magento cache:flush

When the cache is emptied, the site will be fully effective unless there is somewhere in the process something went wrong.


In Joomla is the configuration file directly into the public_html and called  configuration.php . 
The values that you should be put to good database in this file:

  • public $ host = “localhost”;
  • public $ user = ‘ database-username “
  • public $ password = ‘ Database Password ‘;
  • public $ db = ‘ database name ‘;
  • public $ log_path = ‘/ home / DirectAdmin username /domains/;
  • public $ tmp_path = ‘/ home / DirectAdmin username /domains/;

Save the configuration file and your Joomla site will have access both from now until the correct database and store the temporary files in the right place.