3

I follow this guide.

http://devdocs.magento.com/guides/v2.1/install-gde/install/cli/install-cli-install.html

I tried to run web installation but it always got stucked so now i try this.

when i go to mysql as root

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0,00 sec)

there are not any tables for magento.

So i run this command given in the link

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 [email protected] \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=USD --timezone=America/Chicago --use-rewrites=1

but mine cant run magento so i use ./magento

root@vegan:/var/www/html/magento2/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 [email protected] --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
SQLSTATE[HY000] [1045] Access denied for user 'magento'@'localhost' (using password: YES)



  [InvalidArgumentException]   
  Parameter validation failed  

and other green writings

setup:install [--backend-frontname="..."] [--key="..."] [--session-save="..."] [--definition-format="..."] [--db-host="..."]

[--db-name="..."] [--db-user="..."] [--db-engine="..."] [--db-password="..."] [--db-prefix="..."] [--db-model="..."] [--db-init-statements="..."] [-s|--skip-db-validation] [--http-cache-hosts="..."] [--base-url="..."] [--language="..."] [--timezone="..."] [--currency="..."] [--use-rewrites="..."] [--use-secure="..."] [--base-url-secure="..."] [--use-secure-admin="..."] [--admin-use-security-key="..."] [--admin-user="..."] [--admin-password="..."] [--admin-email="..."] [--admin-firstname="..."] [--admin-lastname="..."] [--cleanup-database] [--sales-order-increment-prefix="..."] [--use-sample-data] [--magento-init-params="..."]

it says in informaton

--db-user

User name of the Magento database instance owner.

Default is root.

so i use my mysql password and admin name for it. this time it works but another errors

root@vegan:/var/www/html/magento2/bin# ./magento setup:install --base-url=http://127.0.0.1/magento/ --db-host=localhost --db-name=magentodb --db-user=root --db-password= root --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --cleanup-database help



  [RuntimeException]   
  Too many arguments.  

SO, i decrease parameters. but again same

root@vegan:/var/www/html/magento2/bin# ./magento setup:install --base-url=http://127.0.0.1/magento/ --db-host=localhost --db-name=magentodb --db-user=root --db-password= root 



  [RuntimeException]   
  Too many arguments. 

i can see

http://localhost/magento2/setup/#/landing-install

page here. i think there are no errors. i can run also setup but it stuck at %66 %67. yesterday i completed this but it was not adding to shopping card, today i deleted all php 5.6 7.0 in my pc and reinstall all. But now, it cant install..

what can be reason? i downloaded magento from web and extracted to ww/html

directory is

/var/www/html/magento2/bin

even for this errors

root@vegan:/var/www/html/magento2/bin# ./magento setup:install admin-user="root"



  [RuntimeException]   
  Too many arguments.

By the way, i forgot to put.

i create user and db before

mysql> CREATE DATABASE prestashopdb;
7- mysql> CREATE USER magento@localhost IDENTIFIED BY 'magento';
8- mysql> GRANT ALL PRIVILEGES on magentodb.* to magento@localhost;
9- mysql> FLUSH PRIVILEGES;
10- mysql> exit
11- sudo service apache2 restart
12- sudo service mysql restart
3
  • i have got a different problem installing Magento 2.2 using command line. this is the error message: [Symfony\Component\Console\Exception\RuntimeException] The "-?" option does not exist. this is the command line: > php bin/magento setup:install --base-url=dev.myshop.com --db-host=localhost --db-name=my_shop --db-user=1234567 --db-password=pwd123456 --admin-firstname=Magento --admin-lastname=User [email protected] --currency=USD --timezone=America/Chicago --use-rewrites=1 --admin-user=superadmin --admin-password=12345678asdf as you see, I don't use the -? anywhere in there. an
    – Gery
    Commented Nov 9, 2018 at 18:01
  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review Commented Nov 9, 2018 at 20:24
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review
    – Jarnail S
    Commented Nov 10, 2018 at 1:57

7 Answers 7

3

You have to create database 1st from command line or PHPMyAdmin. After creating database, run below command to install using command line.

php bin/magento setup:install --base-url=http://127.0.0.1/magento2/ \ --db-host=localhost --db-name=rock --db-user=root --db-password= \ --admin-firstname=Magento --admin-lastname=User [email protected] \ --admin-user=admin --admin-password=admin123 --language=en_US \ --currency=USD --timezone=America/Chicago --use-rewrites=1

Above command will install magento2 quickly than web interface.

7
  • Hello sir. i tried with web and it succeeded but now anther errors
    – fff
    Commented Sep 8, 2016 at 7:10
  • What other errors you are seeing? Commented Sep 8, 2016 at 7:12
  • 404 for localho magento. fr localhost it workds
    – fff
    Commented Sep 8, 2016 at 7:22
  • enable mod_rewrite module. Commented Sep 8, 2016 at 7:28
  • ,i already enabled caner@vegan:~$ sudo a2enmod rewrite Module rewrite already enabled
    – fff
    Commented Sep 8, 2016 at 7:33
4

Try that it works.

php bin/magento setup:install --base-url="http://www.example.com/staging/"  --db-host="localhost" --db-name="magento_staging" --db-user="magento_staging" --db-password="PASSWORD" --admin-firstname="Magento" --admin-lastname="User" --admin-email="[email protected]" --admin-user="MagentoAdmin" --admin-password="Magento@#123K" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1"
2

Removing the backslashes was the problem for me with this error: too many arguments expected arguments command.

1

You need to create the database and a user for the database first. Then include these in the install command.

It might be easier to use the web installation, at what point do you get stuck?

2
  • At &66 %67 . i will tell you now. again %67 Module 'Magento_Rss': Module 'Magento_CatalogRuleConfigurable': Module 'Magento_Authorizenet': Module 'Magento_OfflineShippingSampleData': Installing data... Module 'Magento_BundleSampleData': Installing data... Module 'Magento_ConfigurableSampleData': Installing data...
    – fff
    Commented Sep 7, 2016 at 16:13
  • again Module 'Magento_OfflineShippingSampleData': Installing data... Module 'Magento_BundleSampleData': Installing data... Module 'Magento_ConfigurableSampleData': Installing data...
    – fff
    Commented Sep 7, 2016 at 16:42
1
php bin/magento setup:install --base-url="http://foo.test" --db-host="127.0.0.1" --db-name="magento_db" --db-user="root" --db-password="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin-123" --language="en_GB" --currency="GBP" --timezone="Europe/London" --use-rewrites="1"

In the above command change --db-host="localhost" to --db-host="127.0.0.1"

0

Having tried all the solutions here while installing magento v2.4.2 community version in my localhost I had to remove backslashes as well as double quotes and that is how it worked for me. My command was as follows :

php bin/magento setup:install --base-url=http://127.0.0.1/magento/  --db-host=localhost --db-name=magentodb --db-user=magento --db-password=magento --admin-firstname=Magento --admin-lastname=Magento [email protected] --admin-user=MagentoAdmin --admin-password=Magento@123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1
0

Use single quotes instead of double quotes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.