E
E
entermix2015-08-27 21:29:26
linux
entermix, 2015-08-27 21:29:26

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)

Through phpmyadmin everything is OK, what could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Night, 2015-08-27
@entermix

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)

M
Mikhail Sokolov, 2015-08-28
@loodev

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 question

Ask a Question

731 491 924 answers to any question