Author Topic: PHP to Database communication error. "unable to connect " & " access denied  (Read 4210 times)

Offline roger2

  • Jr. Member
  • **
  • Posts: 11
PHP to Database communication error.    "unable to connect "  &  " access denied"

error in installer  activated in web browser.........................
http://192.168.1.110/roundcube/installer/index.php?_step=3
DSN (write):  NOT OK(SQLSTATE[HY000] [1045] Access denied for user 'roundcube'@'localhost' (using password: YES))


error on login page , activated in web browser......................
http://192.168.1.110/roundcube/
Unable to connect to the database!


error in Mysqld log ......................
 tail -f    /var/log/mysqld.log
 [Note] Access denied for user 'roundcube'@'localhost' (using password: YES)


error in roundcube logs .........................
 /var/www/html/roundcube/logs/errors
 Access denied for user 'roundcube'@'localhost' (using password: YES) (GET /roundcube/)
 Access denied for user 'roundcube'@'localhost' (using password: YES) in /var/www/html/roundcube/program/lib/Roundcube/rcube_db.php on line 177 (GET /roundcube/)

Running Centos 8  with upgraded PHP (7.4.19)


I'm at a loss ....The roundcube user has .... in mysqld

 ///// GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'localhost'; //////

so why the error?


PS.

I got lazy & copied the config file from a working FC34 config & put it into the Centos8.

The "installer" detected it & said  ...................."OK, lazy people can download the updated config file here: config.inc.php"

HOW ABOUT THAT!!!!!!!



Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Did you run
Code: [Select]
FLUSH PRIVILEGES; after you ran the MySQL grant command?

Offline roger2

  • Jr. Member
  • **
  • Posts: 11
yes .....the script did that..... as per

USE mysql;
CREATE USER 'roundcube'@'localhost' IDENTIFIED BY 'mypassword';
GRANT USAGE ON * . * TO 'roundcube'@'localhost' IDENTIFIED BY 'mypassword';
CREATE DATABASE IF NOT EXISTS `roundcube`;
GRANT ALL PRIVILEGES ON `roundcube` . * TO 'roundcube'@'localhost';
FLUSH PRIVILEGES;

Offline roger2

  • Jr. Member
  • **
  • Posts: 11

i think the problem  needs to focus on LINE 177   (                'line' => __LINE__, 'file' => __FILE__,  )

/var/www/html/roundcube/program/lib/Roundcube/rcube_db.php on line 177 (GET /roundcube/)

# sed -n '177p'   /var/www/html/roundcube/program/lib/Roundcube/rcube_db.php

                'line' => __LINE__, 'file' => __FILE__,