Rate this post

Part 9: Update deployment config

Welcome to our serial articles on Magento 2 Command Lines (CLI)!

You know Magento 2 has provided the powerful command-line interface tool (CLI). It allows you to perform tasks including installation, configuration, database backups, compiling LESS etc. Today I will show you how to update the development config of Magento store after installed, such as: backed uri, database name, database table prefix, etc. Before starting this guide, please review our previous posts.

Update Magento deployment configuration

php bin/magento setup:config:set [–<parameter>=<value>, …]

The options and values are listed in table below

Option Value Required
–backend-frontname Magento backend uri, for example: admin, backend, admin-magento, etc no
–db-host – The database server’s fully qualified host name or IP address

– Localhost (default) or

–db-name The database name which Magento installed on no
–db-user The user name of Magento database owner no
–db-password The password of database use no
–db-prefix The prefix of tables in database. The prefix can be a maximum of five characters in length. It must begin with a letter and can include only letters, numbers, and underscore characters. no
–session-save Use any of the following:

– “db” to store session data in the database. Choose database storage if you have a clustered database; otherwise, there might not be much benefit over file-based storage.

– “files” to store session data in the file system. File-based session storage is appropriate unless the Magento file system access is slow or you have a clustered database.

–key If you have one, specify a key to encrypt sensitive data in the Magento database. If you don’t have one, Magento generates one for you. no
–db-init-statements Advanced MySQL configuration parameter. Uses database initialization statements to run when connecting to the MySQL database.

Default is SET NAMES utf8;.

Consult a reference similar to this one before you set any values.

–http-cache-hosts – Comma-separated list of HTTP cache gateway hosts to which to send purge requests. (For example, Varnish servers.) Use this parameter to specify the host or hosts to purge in the same request.

– Format must be <hostname or ip>:<listen port>, where you can omit <listen port> if it’s port 80. For example, –http-cache-hosts=,



File Upload in Magento 2 Store Configuration - Magento 2.3
How to Override a Template File in Magento 2 - Magento 2.3