If you get the following error during magento 2 installation:
magento2$ php bin/magento setup:install
SQLSTATE[HY000]  Access denied for user 'root'@'localhost' (using password: NO)
User Name is a required field.
First Name is a required field.
Last Name is a required field.
Please enter a valid email.
Password is required field.
Your password must be at least 7 characters.
Your password must include both numeric and alphabetic characters.
A frequent problem during Magento 2 installation (using php bin/magento setup:install ) is a site running out of memory and generating an error like this – “PHP Fatal error: Allowed memory size of NNN bytes exhausted”. This fatal error means that your hosting or local machine is not able to provide enough memory for the installation script to run correctly.
There are full error and php stack trace:
$ php bin/magento setup:install --admin-firstname name \
--admin-lastname lastname --firstname.lastname@example.org
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 5 bytes)
on line 228