Answer the question
In order to leave comments, you need to log in
Why does the database connection fail?
I'm trying to connect to the database through root, the database user, in all cases I get an error:
mysql_connect(): Access denied for user 'apache'@'localhost' (using password: NO)
Answer the question
In order to leave comments, you need to log in
The error says that you are logging in as an apache user and without a password.
This most likely happens because you do not pass the details at all (login-password)
If it's a console then add "-p" at the end of the command like this:
or -p (password concatenated)
mysql -uapache -pPassword
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question