koha-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-bugs] [Bug 1382] New: Koha fails to install when MySQL DB is on lo


From: bugzilla-daemon
Subject: [Koha-bugs] [Bug 1382] New: Koha fails to install when MySQL DB is on localhost
Date: Mon, 9 Jul 2007 10:03:54 -0700 (PDT)

http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=1382

           Summary: Koha fails to install when MySQL DB is on localhost
           Product: Koha
           Version: 2.2.9
          Platform: PC
        OS/Version: Linux - Gentoo
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Installation
        AssignedTo: address@hidden
        ReportedBy: address@hidden
         QAContact: address@hidden


I'm trying to install Koha 2.2.9 on a Gentoo Linux box (kernel 2.6.20) w/MySQL
5.0.40 .  (I know MySQL 5 isn't fully supported yet, but I don't think this is
a v4-vs-v5 issue).

During the installation, I use the default of "localhost" for the database
host, then choose "kohaadmin" as my user, and (e.g.) "foobar" for a password.

Later, when the installer tries to create the database, I get back this
message:
---------------------------------------------------------
Creating the MySQL database for Koha...

ERROR 1045 (28000): Access denied for user 'kohaadmin2'@'localhost' (using
password: YES)

DBI connect('Koha:localhost','kohaadmin2',...) failed: Access denied for user
'kohaadmin2'@'localhost' (using password: YES) at
/usr/local/koha/intranet/modules/C4/Context.pm line 411
Can't call method "prepare" on an undefined value at
scripts/updater/updatedatabase line 1553.
Problem updating database...
---------------------------------------------------------

The database is created, but it's not being populated correctly due to some
permission problems.  Looking at my MySQL debug logs, I see this line:

GRANT ALL PRIVILEGES on Koha.* to 'kohaadmin' IDENTIFIED BY 'foobar'

Now, this syntax doesn't appear to be correct for either MySQL 4.1 or MySQL 5.0
.  According to both http://dev.mysql.com/doc/refman/4.1/en/adding-users.html
and http://dev.mysql.com/doc/refman/5.0/en/adding-users.html , if you want a
user to have localhost access, it's necessary to explicitly specify that in the
GRANT ALL PRIVILEGES string.  (the default GRANT string, which is used by
Install.pm, grants privileges to the user from any host OTHER THAN localhost.) 
So to fix this, I edited Install.pm and changed line 1803 from this:

system("$mysqldir/bin/mysql '-u$mysqluser' -e \"GRANT ALL PRIVILEGES on
".$database.".* to '$user' IDENTIFIED BY '$pass' \" mysql");

to these two lines:

system("$mysqldir/bin/mysql '-u$mysqluser' -e \"GRANT ALL PRIVILEGES on
".$database.".* to '$user'\@'localhost' IDENTIFIED BY '$pass' \" mysql");
system("$mysqldir/bin/mysql '-u$mysqluser' -e \"GRANT ALL PRIVILEGES on
".$database.".* to '$user'\@'%' IDENTIFIED BY '$pass' \" mysql");

Just thought I'd pass it along.




------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]