The syntax of the command
create_superlibrarian.pl --userid <your userid> --password <your password> --branchcode <your library branchcode> --categorycode <your lbrary categorycode> --cardnumber <your cardnumber>
Retrieving Library and Patron Category Codes from Koha Database using MySQL Query
If you have forgotten your super librarian account credentials, there is a way to retrieve the necessary information without having to install any GUI database administration tools like phpMyAdmin. In this blog post, I will guide you through a simple MySQL query that can help you retrieve the required library and patron category codes from the Koha database.
First, you will need to access your Koha database via the MySQL shell. To do so, open your terminal and enter the following command:
sudo su
This command will switch your user to the root user, which will give you the necessary privileges to access the Koha database. Next, enter the following command to enter the MySQL shell:
mysql -uroot -p
You will be prompted to enter the root password for the MySQL server. Once you have entered the correct password, you will be taken to the MySQL prompt. Next, enter the following command to select the Koha database:
use koha_library;
Note that the database name may vary depending on the name you gave to your Koha database during installation. Once you have selected the correct database, enter the following MySQL query to retrieve the library code and patron category code:
SELECT branchcode,categorycode
FROM borrowers;
This query will retrieve the branch code and category code for all borrowers in the Koha database. The branch code corresponds to the library code, while the category code corresponds to the patron category code.
Now, using the retrieved codes, we can create a super librarian. To learn how to create this new super librarian, please read the below blog post.
Apply the following commands to create the Super User.
Load environmental variables
sudo su
export PERL5LIB="/usr/share/koha/lib"
export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml"
Enter inside the Super User script folder
cd /usr/share/koha/bin/devel/
Super Librarian command
Here is an example of Super Librarian command,
./create_superlibrarian.pl --userid prasan --password Prasan@123 --branchcode TS --categorycode LIS --cardnumber F10019
Here are the details of examples used in the command:
User ID- prasan
Password- Prasan@123
Branchcode- TS
Patron category code- LIS
Cardnumber-F10019
No comments:
Post a Comment