Configuring the Database Server
- Updated on 22 Nov 2019
- 1 minute to read
This article describes how you can change your database server.
Spryker offers support for using MySQL or PostgreSQL as database servers. By default, the virtual machine is configured to use the PostgreSQL database server, but you can easily change it so that it uses the MySQL database server.
To configure the database server you want to use, you have to keep in mind these constants and use them in the corresponding configuration file:
The configuration files are placed under the config/Shared/ folder.
config/Shared/config_default-development.php is the configuration file for the development environment.
Using MySQL as a DB Server
<?php $config[PropelConstants::ZED_DB_ENGINE] = $config[PropelConstants::ZED_DB_ENGINE_MYSQL]; $config[PropelConstants::ZED_DB_PORT] = 3306;
Using PostgreSQL as a DB Server
<?php $config[PropelConstants::ZED_DB_ENGINE] = $config[PropelConstants::ZED_DB_ENGINE_PGSQL]; $config[PropelConstants::ZED_DB_PORT] = 5432;
Creating the Database
To create or update the database configuration, run the installation tool using this command:
If the application is already installed on your virtual machine and you switch to a different database server, you can also run:
-h option to see the help page for this command.