Good day. May I ask how you delete the contents of the Gibbon database? My purpose is to delete the database (or its contents) and then to re-encode and re-import data to Gibbon database during the testing. Below are the steps I followed that will generate error message on number 5. There’s still error even if I restart the server after step 3.
drop user gibbon@localhost;; <-i forgot if this was my step 1 or step 2
drop database gibbon; <-i forgot if this was my step 1 or step 2
flush privileges;
create database gibbon;
create user ‘gibbon’@‘localhost’ identified by ‘dbpassword’; <-dbpassword is replaced with the database’s password
I forgot to note the error message but it started with “HY00”. My installation is Ubuntu Linux 20.04 and mariadb.10.3
Hi Richard, these commands look about right, but you don’t need 4 or 5, as Gibbon can do this part during installation. I think the key is to do 2., and I think then 1 and 3 might well be superfluous.
TBH I usually use a MySQL client (e.g. Sequel Ace or DBeaver) to do this, as it makes life much easier.
Hi Ross I have downloaded dbeaver. May I ask what sql commands you enter in dbeaver or sql ace everytime you want to delete Gibbon database contents?
I tried to only do ‘drop database gibbon;’ and when I opened [GibbonPath]/installer/install.php this is the message:
Installation - Step 1
The directory containing the Gibbon files is not currently writable, or config.php already exists in the root folder and is not empty or is not writable, so the installer cannot proceed.
I restarted the server but the same error message appears. Below are the next steps I did but the same message still appears:
sudo mariadb
drop database gibbon;
drop user gibbon@localhost;
flush privileges;
exit;
[restart server and view install.php]
sudo mariadb
create database gibbon;
create user ‘gibbon’@‘localhost’ identified by ‘replacethiswithdbpassword’;
revoke all privileges on . from ‘gibbon’@‘localhost’;
grant select, insert, update, delete, create, drop, index, alter, lock tables on gibbon.* to ‘gibbon’@‘localhost’;
flush privileges;
exit
sudo systemctl restart mariadb
sudo systemctl restart apache2
[restart server and view install.php]
revoke all privileges on . from ‘gibbon’@‘localhost’;
Hi Ross, thanks for your patience because this topic is outside Gibbon. Please let me know if I understand correctly the steps you do whenever you want to delete your Gibbon data:
Open Sequel Ace and choose Database > Delete Database and choose the database to be deleted
Point browser to [GibbonPath]/installer/install.php, and on the 2nd page will ask for the database details
The 3rd page will display when the database has been created by the Gibbon web app
Hi Richard, no problem at all, we are happy to help. Your steps are indeed correct, although for 1. you need to connect Sequel Ace to your MySQL server, and then select the relevant database after the connection is established. Cheers, Ross.
Thanks Ross. I will play around with dbeaver. Below are its settings that worked for me (Server: Ubuntu Linux 20.04 and mariadb.10.3; workstation: Windows 10). I had to add them so that the database can be accessed from Windows. But please let me know if these are inappropriate / incorrect settings, or if there are faster ways to go about things. Thank you.
Comment “bind-address” from file /etc/mysql/mariadb.conf/50-server.cnf ; If I remember correctly this was originally set to “localhost” ; But I later set this to the server’s IP address and it also seemed to work
Under mariadb, in addition to the existing “create user ‘gibbon’@‘localhost’ identified by ‘replacethiswithdbpassword’;” , execute additional command “create user ‘gibbon’@‘%’ identified by ‘replacethiswithdbpassword’;”
Under mariadb, in addition to the existing “grant select, insert, update, delete, create, drop, index, alter, lock tables on gibbon.* to ‘gibbon’@‘localhost’;”, execute additional command “grant select, insert, update, delete, create, drop, index, alter, lock tables on gibbon.* to ‘gibbon’@‘%’;”
Under mariadb, execute command “flush privileges;”
Hi Richard, these look about right, but do keep in mind that ‘gibbon’@‘%’ allows access from any IP address. For security reasons I’d recommend that you limit this to particular IP addresses. Thanks for sharing the solution that worked for you.