[Koha] Creating a database

Thomas Daly letterbox at daladi.com
Tue Feb 28 03:16:56 NZDT 2023


Thank you for your help.

I was actually using MySQL, not MariaDB.  I tried setting the MySQL root
password to null, but then ran into a different error.  So I've now replaced
MySQL with MariaDB.

Since the 'Koha on Debian' guide says that you can use either MariaDB or
MySQL, I think it ought to make clear any differences in configuration that
are needed when using MySQL, such as the need for a null password.

-----Original Message-----
From: René Seindal <rene at seindal.it> 
Sent: 26 February 2023 17:59
To: Thomas Daly <letterbox at daladi.com>
Cc: koha at lists.katipo.co.nz
Subject: Re: [Koha] Creating a database

On Debian you don't need to do anything.

The superuser has access to the database without a password.

It is described in the package documentation:
/usr/share/doc/mariadb-server-10.5/README.Debian.gz

* ROOT USER AUTHENTICATION VIA UNIX SOCKET
==========================================

On new installs no root password is set and no debian-sys-maint user is
created anymore. Instead the MariaDB root account is set to be authenticated
using the Unix socket, e.g. any mysqld invocation by root or via sudo will
let the user see the mysqld prompt.

You may never ever delete the mysql user "root". Although it has no password
is set, the unix_auth plugin ensure that it can only be run locally as the
root user.

The credentials in /etc/mysql/debian.cnf specify the user which is used by
the init scripts to stop the server and perform log rotation. This used to
be the debian-sys-maint user which is no longer used as root can run
directly.

If you have start/stop problems make sure that the /etc/mysql/debian.cnf
file specifies the root user and no password. In the long run please stop
using that file as is has been obsoleted.



On 2023-02-26 15:16, Thomas Daly wrote:
> Hello,
> 
> 
> 
> I'm following the 'Koha on Debian
> <https://wiki.koha-community.org/wiki/Koha_on_Debian> ' guide but have 
> got stuck at the 'Create a Koha instance' part.  This section doesn't 
> say anything about supplying the 'koha-create' command with a MySQL 
> username and password.  I don't see how 'koha-create' can create the 
> database if it doesn't know the MySQL root password.
> 
> 
> 
> I tried putting the MySQL root login details in both /etc/koha/passwd 
> and /etc/mysql/koha-common.cnf, but I get this error:
> 
> 
> 
> # koha-create --create-db --passwdfile /etc/koha/passwd zilib
> 
> WARNING: The koha-common.cnf file is a dead soft link!
> 
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
> password: NO)
> 
> 
> 
> koha-common.cnf is not actually a dead link but a text file.



More information about the Koha mailing list