I try to connect to the database through root, the database user, an error occurs in all cases:

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

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

Closed due to the fact that off-topic participants are Visman , Peter Olson , tutankhamun , Vladimir Martyanov , Dmitriy Simushev 28 Aug '15 at 9:50 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Visman, Peter Olson, Vladimir Martyanov, Dmitriy Simushev
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    please insert the connection code snippet. You can correct the question by clicking edit . - aleksandr barakin
  • This is a connection through the Kohana 3.3 framework - entermix
  • then there must be a configuration file in which it is indicated that you need to connect as apache@localhost , and you, judging by the contents of the question, need to change this name to root@localhost . although I would not recommend to connect as root : it is better to create an unprivileged user who should be given the necessary rights to the database being used. - aleksandr barakin
  • Yes, the fact of the matter is that there are no connection settings through apache, on another server everything is ok .. - entermix
  • Everything turned out to be simpler, just another config, overlapping the one I configured, and tried to connect without a login and password. Thank you) - entermix

1 answer 1

Another config, overlapping the one I configured, i.e. in fact, the connection took place without a login and password.