Create Super Librarian by command line in koha LMS

 

 Create Super Librarian by command line in koha LMS


Sometimes Librarians forget the login credentials (User ID and Password) in the koha or the koha system has blocked the patrons account because of several unauthorized (wrong password) attempts to log in. In that case, we can create a new user account with the superuser/admin rights by the command lines.
Lets us know how to create a new Super Librarian account.

1. Activate environmental variables

sudo su

export PERL5LIB="/usr/share/koha/lib" 

export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml"

2. Change the super librarian script directory 

cd /usr/share/koha/bin/devel/

3. Executive the following command to create a patron with the super librarian rights

./create_superlibrarian.pl --userid Librarian --password Librarian@123 --branchcode MAIN --categorycode STA --cardnumber 2000

In the above command following details have been used. you can change the details accordingly 

Patrons User ID- Librarian

Patrons Password- Librarian@123

Library branchcode- MAIN

Patron categorycode- STA

Patron cardnumber-2000

NB:- Put the branchcode and patron categorycode carefully, These must be the same as you have created in your koha server. If you forgot the Patron categorycode and  branchcode then apply the following commands to retrieve them.

Enter the MySql Databases

mysql -uroot -p

(Enter mysql password)

Select Koha database

use koha_library;

Retrieve the branchcode and patron categorycode

SELECT branchcode,categorycode 

FROM borrowers;


Refer: 

Comments

Popular posts from this blog

Install Dspace 7.2 on Ubuntu 22.04 LTS

How to delete library data in koha using the command line

Koha INSTALLATION

Total views