Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Create the Magento database schema

First steps

  1. Log in to the Magento server as, or switch to, a user who has permissions to write to the Magento file system. One way to do this is to switch to the Magento file system owner.

If you use the bash shell, you can also use the following syntax to switch to the Magento file system owner and enter the command at the same time:

1
su <Magento file system owner> -s /bin/bash -c <command>

If the Magento file system owner does not allow logins you can do the following:

1
sudo -u <Magento file system owner>  <command>
  1. To run Magento commands from any directory, add <magento_root>/bin to your system PATH.

Because shells have differing syntax, consult a reference like unix.stackexchange.com.

bash shell example for CentOS:

1
export PATH=$PATH:/var/www/html/magento2/bin

You can also run the commands in the following ways:

  • cd <magento_root>/bin and run them as ./magento <command name>
  • <magento_root>/bin/magento <command name>
  • <magento_root> is a subdirectory of your web server’s docroot. Need help locating the docroot?

In addition to the command arguments discussed here, see Common arguments.

Prerequisites

Before you run this command, you must Create or update the deployment configuration.

Configure the database and add data

Command usage:

1
2
magento setup:db-schema:upgrade
magento setup:db-data:upgrade

To see the status of the database, enter

1
magento setup:db:status
Updated