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?
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?
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','');
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 .
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