Apache2 error in linux

0

I installed everything right on Linux, I threw my folder in the www directory when I opened the broswer and received the following warning:

  

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

How do I solve it?

    
asked by anonymous 21.01.2016 / 13:58

3 answers

1

No mysql_connect you are passing a password to connect to the bank in localhost .

However, the user root has no password. Then just remove the password you are passing and try again.

mysql_connect ('localhost','root','');
    
14.10.2016 / 21:07
1

1) This is not a problem with Apache2, but a connection to MySQL.

2) You are trying to access MySQL with the root user on localhost without using a password (using password: NO) , but root must have one (it is the opposite of rubStackOverflow said).

3) If possible, avoid using the mysql_ * functions of PHP because they are obsolete and no longer work in PHP 7.0. Give preference to PDO .

    
14.10.2016 / 21:34
0

You can reset your root password . Keep in mind that it is not advisable to use root without a password. Soon after you have to restart the service for the changes to work correctly using:

sudo /etc/init.d/mysql restart
    
14.10.2016 / 21:23