Author Topic: Database Installer steps all OK but cannot login mysql error 1045  (Read 156 times)

Offline Loggy

  • Newbie
  • *
  • Posts: 6
Database Installer steps all OK but cannot login mysql error 1045
« on: September 08, 2021, 12:38:01 PM »
Ubuntu 20.04 LTS recent upgrade

nginx 1.18.0 fast_cgi - this is the only web page, the server is IP protected, running https with only trusted port IP access, no client caching (expires 0;)

php7.4-fpm with a single pool.d file that runs under www-data:mail, Postfix/Dovecot working OK - forwarding, parsing etc mail or writing to Maildir.

The final stage is to implement Roundcube to give complete control of my email.:) So mariadb 10.3.31, roundcube 1.4.3 are from Ubuntu repositories.

The database user roundcube and database roundcube as per the INSTALL instructions, char utf8, collate utf8_general_ci.

I had to add the privileges individually (set Select_priv="Y" where User = "roundcube" - grant all did nothing).  They were flushed and I am able to add a table to roundcude and insert into it from user roundcube as well.

The installer runs and checks OK - DSN (write), DB Schema, DB Write and DB Time are all OK.  I can send mail out and the IMAP login works (SORT capability: yes)

But when I load the root page (ie /index.php), I get the DATABASE ERROR: CONNECTION FAILED! message!  The $err_str is SQLSTATE[HY000][1045] which I print_r from index.php

I have tried everything I can think of now, after a week of googling.  The message suggests it is a password error but I have zillion-checked this. 

I can login normally using mariadb -p -u roundcube roundcube.  I can login to mariadb root OK.

I can access mysql using a small php program and mysqli_connect etc. which works from different users mail, www-data, postfix and dovecot (they are all in the same group anyway)

I have uninstalled and reinstalled both mariadb and roundcube (getting desparate!).

It is as if the connection in rcube_db is doing something different to the connection in test.php as per the connection in config.inc.php

[I have left the installer directory in the root for the moment.]

Very puzzled.  Any hints/suggestions/ideas other than migrating to gmail????

TIA

Offline Loggy

  • Newbie
  • *
  • Posts: 6
Re: Database Installer steps all OK but cannot login mysql error 1045
« Reply #1 on: September 09, 2021, 04:44:54 AM »
Whatever was the cause, I updated to the latest stable 1.4.11 from the instructions on https://www.mysterydata.com/install-and-update-roundcube-latest-version-on-ubuntu-vestacp/

And the problem has disappeared!  It immediately connected with all my mail in the Maildir tree visible.

I did notice that while my password was correctly updated in /etc/roundcube/debiand-db-roundcube.php it had not been copied into /etc/roundcube/debian-db.php so this may have been the problem all along.

And as my password includes a few special characters which were originally translated into %xx in config/config.inc.php I left them as special characters in the new config.inc.php and it still worked.

A message to Ubuntu package maintainer is on its way!

Now to learn the ins and outs of running roundcube which looks very nice.