Personal tools
You are here: Home Documentation FAQs How to change Koha default user name and password?
Document Actions

How to change Koha default user name and password?

Up to Table of Contents

This FAQ applies to: 3.0, 3.1

Is your operating system Windows?

  • Open  a command prompt and type: cd \mysql\bin
  • Type: mysqladmin -u koha -p password YourNewPasswordHere
  • You will be prompted for the current password which is "koha"

The above action will reset the mysql password.

Open the C:\etc\koha.conf and set the new password in the pass=koha line.

Restart apache to implement the change

Updated conf

Posted by Joe Atzberger at Jul 29, 2009 10:09 PM
The current KOHA_CONF (koha-conf.xml) file is XML, so the user and password lines looks like:
<database>koha_db</database>
<user>whoever</user>
<pass>foobar</pass>

This specifies what the application will use to try to access mysql. So if that doesn't work for you on the command line, like:
   mysql -uwhoever -pfoobar koha_db

Then it won't work for Koha either.

Note that if you attempt to change the username, you will have to repeat the GRANT permissions steps from the INSTALL instructions, because the new user will not have been granted permissions. You should also remove the permissions granted to the old username, for security. More likely, you just shouldn't change the username.

More About Changing Default Password

Posted by Rick Forristall at Dec 28, 2009 02:45 PM
I, too had a bit of trouble trying to find how to change the default password and the post from Joe Atzberger was very helpful, but I still ran into a roadblock. What I found was the koha-conf.xml file may be in multiple locations. In fact I was updating the file in the wrong location. I posted my question on the Koha Dev list and received 2 posts back that were very helpful.
Koha Devel List: http://lists.koha.org/mailman/listinfo/koha-devel

Here's the summary that led me to be able to reset the default password:
===========================================
Some background info is required so anyone reading this can understand and apply to their situation.

We installed the Koha unconfigured virtual appliance (VMDK) from here:
http://kylehall.info/[…]/


Normally one expects the admin password to reside in something like:
/koha/etc/koha-conf.xml

A search of this file found a location here
(search command something like this: find /home -iname 'koha-conf.xml'):

/home/koha/koha-dev/etc/koha-conf.xml which had the default password value like this

<db_scheme>mysql</db_scheme>
<database>koha</database>
<hostname>localhost</hostname>
<port>3306</port>
<user>kohaadmin</user>
<pass>defaultpasswordwashere</pass>

A copy of this file is also in here:
/home/koha/kohaclone/blib/KOHA_CONF_DIR/koha-conf.xml

I was originally changing the password in the second location, and not the first - - once I found and changed it in the first file, all seemed to work (this was after I changed the kohaadmin@localhost user's password in mysql and restarted apache2)


=================================================================
So, lesson learned -- here are steps to consider to change default password?

1. look for all locations of "koha-conf.xml" and change the password in all locations. In terminal a command something like this:
   find /home -iname 'koha-conf.xml'

   A SPECIAL NOTE from Chris Cormack that helped:
   Heres a tip, look in the /etc/apache2/sites-enabled/koha
   (or whatever your koha-httpd.conf file is called). Find
   what flle it has set as KOHA_CONF .. then change that one.
   That is the file it will be using. Then the rest of
   the steps [ below ] work fine :)

NOTE 2: if you installed the Virtual Appliance as we did, look
in /home/koha/koha-dev/etc/koha-httpd.conf for the above reference
and look for this line:
SetEnv KOHA_CONF ...


2. restart apache2 (command: /etc/init.d/apache2 restart)

3. change kohaadmin@localhost user's password in mysql

Try again to login to your koha admin pages and you should be OK now.

****************************************************************
=========== { SPECIAL THANKS }===================================
Chris Nighswonger from Foundations Bible College who offered multiple solutions to help me solve this problem -- Thanks Chris for trying to figure this out with me!
===========/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/=============