Error: Access denied for user 'root' @ 'localhost' (using password: NO) when accessing Website

1

Good evening,

I've been trying to run a website through a raspberry to access it with remote access. I installed OS Pipplware along with Lamp and phpmyadmin. I sent through the filezilla based on the website and ran everything perfection. Phpmyadmin appeared with errors, which prevented me from importing the database there, but after a reconfiguration I managed to get everything working. However the Website still has the same error:

  

Access denied for user 'root' @ 'localhost' (using password: NO)

And when trying to solve, I noticed that in mysql, both in user

mysql -h localhost -u user -p database_name

as root,

mysql -u localhost -u root -p database_name

The same 1045 (28000) error still occurs: Access denied for user 'root' @ 'localhost' (using password: NO) Does anyone know this error or do you know how to solve it? Thanks for all the help you offer.

    
asked by anonymous 19.06.2015 / 17:37

2 answers

3

1 - Log in to MySQL with:

sudo mysql -u root -p

2 - Type:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; flush privileges;
    
20.04.2018 / 20:40
2

This error indicates that you are trying to access the database by the root user without entering the password ....

Access denied for user 'root'@'localhost' (using password:NO)

Check your database for this user's password and then try:

mysql -u localhost -u root -psenha database_name

password must be "pasted" into -p

    
23.06.2015 / 18:28