cancel
Showing results for 
Search instead for 
Did you mean: 

magento 2 setup install database error

magento 2 setup install database error

sudo ./magento setup:install --base-url=http://127.0.0.1:8500 --db-host=localhost --db-name=magento2 --db-user=root --db-password=1234 --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

-after running above command it shows following error

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

[InvalidArgumentException]
Parameter validation failed

 

9 REPLIES 9

Re: magento 2 setup install database error

Hello @nikhil_mhatre,

 

Can you please run below command in magento2 root directory, don't use sudo

php bin/magento setup:install --base-url=http://127.0.0.1:8500/  --db-host=localhost --db-name=magento2 --db-user=root --db-password=1234  --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US  --currency=USD --timezone=America/Chicago --use-rewrites=1

--
If you've found one of my answers useful, please give Kudos or Accept as Solution

 

Re: magento 2 setup install database error

I am having error to install Magento2

SQLSTATE[HY000] [2002] Connection refused

Parameter validation failed

 

What should I do to resolve this?

Re: magento 2 setup install database error

Hi @ecinitiative ,

I had the same issue. It's happening because the connection was trying to connect to port 8500 which you set in --base-url. You are using localhost with port 8500 so you must specify the MySql port too. In my case, I used MAMP with port 8888 and MySql with port 8889 (--base-url="http://127.0.0.1:8888/" --db-host="127.0.0.1:8889")

Re: magento 2 setup install database error

I will write it accordingly if I need some help!

 

tellthebell

Re: magento 2 setup install database error

Thanks for the solution it worked fine for me as well!

 

 

 

 

WalgreensListens

Re: magento 2 setup install database error

Thanks for the update and quick reply. I'll be sure to keep an eye on this thread.

Re: magento 2 setup install database error

Yes of course i have ran the composer install, there is no more web setup wizard install?, only cli?, im running php 7.3 on Ubuntu, do i need to install some php extension? the docs are not clear. Charter Panorama

Re: magento 2 setup install database error

 

sudo ./magento setup:install --base-url=http://127.0.0.1:8500 --db-host=localhost --db-name=magento2 --db-user=root --db-password=1234 --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

-after running above command it shows following error

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

[InvalidArgumentException]
Parameter validation failed

 

Tellthebell

Re: magento 2 setup install database error

Try to run below command :

bin/magento setup:install \
--base-url=http://localhost/magento2 \
--db-host=localhost \
--db-name=magento \
--db-user=magento \
--db-password=magento \
--admin-firstname=admin \
--admin-lastname=admin \
--admin-email=admin@admin.com \
--admin-user=admin \
--admin-password=admin123 \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \
--use-rewrites=1 \
--search-engine=elasticsearch7 \
--elasticsearch-host=es-host.example.com \
--elasticsearch-port=9200