Magento 2 command line install (too many arguments)
-
14-04-2021 - |
题
so I am trying to make a bash script in Magento, and I am learning from the bottom up. So I have the basic arguments ready to be used in the script I am making, but when I execute
sudo php magento setup:install --admin-user="user"
or a variation with [--admin-user="user"]
I get
[RuntimeException]
Too many arguments.
What am I doing wrong? I would like to put that line in my script, so I can install Magento with user defined variables
I am using Magento 2.0.2 with Sample Data on Ubuntu 15.02
解决方案
I think you have forgot about the --
in front of the command. (So it seems in your screenshot).
其他提示
I had a similar issue and the correct installation command is:
php bin/magento setup:install
--base-url="http://example.co.uk/"
--db-host="localhost"
--db-name="databasename"
--db-user="databaseuser"
--db-password="databasepass"
--admin-firstname="Yourname"
--admin-lastname="Yourname"
--admin-email="hello@example.co.uk"
--admin-user="admin"
--admin-password="setpasswordhere"
--language="en_GB"
--currency="GBP"
--timezone="Europe/London"
--use-rewrites="1"
--backend-frontname="admin"
As mentioned, in your case command line options for the Magento 2 CLI installer require -- before the option name (e.g --base-url="example.com")
Please remove the double brackets and run the following command.
bin/magento setup:install --backend-frontname="adminlogin" \
--key="biY8vdWx4w8KV5Q59380Fejy36l6ssUb" \
--db-host="localhost" \
--db-name="magentodb" \
--db-user="root" \
--db-password="secretpassword" \
--language="en_US" \
--currency="GBP" \
--timezone="Europe/London" \
--use-rewrites=1 \
--use-secure=0 \
--base-url="http://www.newmagento.com" \
--base-url-secure="https://www.newmagento.com" \
--admin-user=adminuser \
--admin-password=admin123@ \
--admin-email=admin@newmagento.com \
--admin-firstname=admin \
--admin-lastname=user \
--cleanup-database
create a new file name it install.sh , use a text editor to paste that command , save it. chmod +x install.sh and do ./install.sh