Fix Magento Installation Errors from Command Line

installationmagento2

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 --admin-email=user@example.com \
--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 --admin-email=user@example.com --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

Best Answer

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 --admin-email=user@example.com \ --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.

Related Topic