Bug 26306 - Access denied for user 'koha_library'@'localhost'
Summary: Access denied for user 'koha_library'@'localhost'
Status: RESOLVED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Installation and upgrade (command-line installer) (show other bugs)
Version: Main
Hardware: All Linux
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-27 10:41 UTC by tommaso spazzali
Modified: 2023-09-22 20:35 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
first line of a history command run on the server (2.06 KB, text/plain)
2020-08-27 10:41 UTC, tommaso spazzali
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tommaso spazzali 2020-08-27 10:41:43 UTC
Created attachment 109223 [details]
first line of a history command run on the server

This might be a bug or not, is given with a workaround and happened restoring a koha-dump backap to a brand new Koha installation.

I installed KOHA 20.05.02.000 on AWS Ubuntu 20 EC2 instance then I tried a koha-restore from a 19.11.05.000 koha-dump backup raise the following error:

ERROR 1396 (HY000) at line 1: Operation DROP USER failed for 'koha_library'@'%'
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1520. at /usr/share/koha/lib/Koha/Database.pm line 116
Something went wrong rebuilding biblio indexes for library
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBI connect('database=koha_library;host=localhost;port=3306','koha_library',...) failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1517.
DBIx::Class::Storage::DBI::catch {...} (): DBI Connection failed: Access denied for user 'koha_library'@'localhost' (using password: YES) at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1520. at /usr/share/koha/lib/Koha/Database.pm line 116
Something went wrong rebuilding authority indexes for library
Restarting apache2 (via systemctl): apache2.service.

I attach the full history that bring to that errors (there is some useless stuff but i prefer to leave it untouched)

note that in a first time I set a password to mariaDB user root

then (1) I removed mariaDB root password but still get the error then I found this link


https://kohageek.blogspot.com/2020/06/dbixclassstoragedbicatch-dbi-connection.html

and with a 
"sudo service memcached restart" 

before the koha-restore command I got no error and the library is perfectly imported

at the end I had to force a 

sudo service koha-common restart

to have the Zebra server running.
Comment 1 Jonathan Druart 2020-08-27 14:55:53 UTC
The correct dump/restore workflow is:

systemctl stop apache2
systemctl stop koha-common
koha-dump
koha-remove
koha-restore
systemctl start koha-common
systemctl start apache2