How to exploit all commands in Magento 2 CLI (Part 8)

In this Article we going to discuss about the Magento 2 Command line (CLI)

Part 8: Install Magento

Everyone knows Magento 2 has a powerful command-line interface tools (CLI). It permits you to complete task including installation, configuration, database backups, compiling LESS etc. Here I will show you how to install Magento using command-line in Magento 2. Before starting this guide please,refer our previous guidelines

Set up Magento using the following command:

php bin/magento setup:install –<option>=<value> … –<option>=<value>

The option and value are listed below:

Option Value Required
-Admin- first name Magento Admin User’s First Name Yes
-Admin- last name Magento Admin User’s Last Name Yes
-Admin- Email Magento Admin User’s Email Yes
-Admin- User Magento Admin User’s User Yes
-Admin Magento Admin User’s Password

 

Yes
-password The password should be at least 7 characters in length and should contain at least one alphabetic and at least one numeric character. Yes
-Base url Base URL to exploit to access your Magento Admin and storefront. It should point to Magento install dir.

http[s]://<host or ip>/<your Magento install dir>/

No
Admin first name Magento Admin first name Yes
–backend-frontname Uniform Resource Identifier (URI) to entrance the Magento Admin.

For example: admin, admin_123, admin_x67, etc.

no
–db-host The database server’s fully qualified host name or IP address.

The default value is localhost (127.0.0.1)

no
–db-name The name of database which is used to install Magento

Default value is magento2

no
–db-user User name of database which is exploit to install Magento.

Default value is root

no
–db-password The password of db-user no
–db-prefix The prefix of tables in Magento db no
–language Language code to exploit in the Admin and storefront.

By applying command below to observe the list of language code:

php bin/magento info:language:list

no
–currency Default currency to employ in the storefront

The following  command below to observe the list of currency:

php bin/magento info:currency:list

no
–timezone Default time zone to exploit in the Admin and storefront.

The following command below to observe the list of timezone:

php bin/magento info:timezone:list

no
–use-rewrites 1: it means you employ web server rewrites for making links in the storefront and Admin.

0: disables the employ of web server rewrites. This is the default.

no
–use-secure 1: It allows the use of Secure Sockets Layer (SSL) in all storefront URLs.Clear in your mind your web server carries SSL before you choose this option.

0: disables the exploit of SSL with Magento. In this case, all other secure URL options are assumed to also be 0. This is the default.

no
–base-url-secure Secure base URL to use to access your Magento Admin and storefront no
–use-secure-admin 1: means you use SSL to access the Magento Admin. Clear in your mind your web server supports SSL before you select this option.

0: means you do not exploit SSL with the Admin. This is the default.

no
–admin-use-security-key 1: causes the Magento software to use a randomly generated key value to access pages in the Magento Admin and in forms. The following key values assist prevent cross-site script fake attacks. This is the default.

0: disables the exploit of the key.

no
–session-save db: to store session data in the database.

files: to store session data in the file system.

no
–key 1: state a key to encrypt sensitive data in the Magento database.

0: Magento creates one for you.

no
–cleanup-database To drop database tables before installing the Magento software. no
–db-init-statements Advanced MySQL configuration parameter. Uses database initialization statements to run when connecting to the MySQL database.Ask a reference related to this one before you put any values.

Default is SET NAMES utf8;

no
–sales-order-increment-Introduction Introduction of sales order enhance ID no
–amqp-host Enterprise Edition only. It doesn’t use the –amqp options unless you have already set up an installation of RabbitMQ. no
–amqp-port Enterprise Edition only. The port to use to connect to RabbitMQ. no
–amqp-user Enterprise Edition only. The user name for connecting to RabbitMQ. no
–amqp-password Enterprise Edition only. The password for connecting to RabbitMQ. no

The following commands are used to install Magento

php bin/magento setup:install --base-url=http://127.0.0.1/magento2/ \

--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \

--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \

--admin-user=admin --admin-password=admin123 --language=en_US \

--currency=USD --timezone=America/Chicago --use-rewrites=1

I hope the following command defines you to install Magento  in Magento 2 command line CLI

Last Update: April 7, 2018  

February 13, 2018   796   Nandini Ramachandran    Operations    
Total 1 Votes:
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook
Twitter
INSTAGRAM
LinkedIn