Error connecting to database

9 posts / 0 new
Last post
la3rk
Error connecting to database

Upgraded to version 2.5 today and now cqrlog will not connect to database, gives TMySQL57Connection message.

From debug = 1 log;

cqrlog --debug=1

Cqrlog Ver:2.5.1 (001) Date:2021-01-24
**** DEBUG LEVEL 1 ****

OS:
Linux version 5.4.0-65-generic (buildd@lcy01-amd64-018) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021
SSL libraries:
libssl.so
libcrypto.so
Loaded 152879 LoTW users
Loaded 139274 eQSL users
Loaded 34473 SCP calls
*
User home directory: /home/olaf/
Program home directory: /home/olaf/.config/cqrlog/
Data directory: /home/olaf/.config/cqrlog/database/
Memebers directory: /home/olaf/.config/cqrlog/members/
ZIP code directory: /usr/share/cqrlog/zipcodes/
Binary dir: /usr/bin/
Share dir: /usr/share/cqrlog/
*
56 us states loaded
Grid map created

No info created after Grid map created.

Seems MariaDB will not start even after a fresh install of MariaDB. Computer is running Ubuntu 20.04.

73 de Olaf - LA3RK

oh1kh
Error connecting to database

HI Olaf!

Yes. Looks like maridb does not start.
In command console try :

whereis mysqld_safe

It should exist in /usr/bin folder. If it does not exist at all there is something wrong with MariaDB. If it is in different folder it may be that cqrlog does not find it.

--
Saku
OH1KH

la3rk
MariaDb do not start

tail error.log
2021-02-02 14:44:40 0 [ERROR] InnoDB: Invalid flags 0x4000 in ./ibdata1
2021-02-02 14:44:40 0 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2021-02-02 14:44:41 0 [Note] InnoDB: Starting shutdown...
2021-02-02 14:44:41 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-02-02 14:44:41 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-02-02 14:44:41 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-02-02 14:44:41 0 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2021-02-02 14:44:41 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2021-02-02 14:44:41 0 [ERROR] Aborting

mysqld is located in /usr/bin folder, but there is something that stops mysql from starting, see above extract from mysql error.log.

Have tried to remove and reinstall mariadb, but so far no success.

73 de Olaf - LA3RK

Olaf Devik LA3RK

oh1kh
MariaDb do not start

Did you have mysql (not MariaDB) before update?
Then it might be that MariaDB can not access your old data.

Make a copy of /usr/bin/cqrlog with console:
sudo cp /usr/bin/cqrlog /usr/bin/cqrlogB

then try to start from console:
cqrlogB --debug=1

It should say you have never used cqrlog before and asks where to save logs. Say local machine.
It creates ~/.config/cqrlogB named folder for use.

If it works ok it proves that MariaDB can't just access your previous logs in ~/.config/cqrlog folder.

--
Saku
OH1KH

la3rk
MariaDB do not start

Saku
Purged mariadb/mysql, reinstalled mariadb and reinstalled cqrlog. (cqrlog was removed when purging mariadb apparently due to dependencies).

Got mariadb up and running, installed cqrlog, copied cqrlog to cqrlogB. Copy of cqrlog works ok.

So then how do I get the normal version cqrlog to run and ideally connect to the old database? Or do I have to delete config files and restore from adif backup?

73 de Olaf - LA3RK

Olaf Devik LA3RK

oh1kh
MariaDB do not start

OK!

If cqrlogB is running then the install is ok.
Did you try once more with cqrlog (without B) if you have reinstalled everything. If that does not work still I assume you have had mysql instead of MariaDB in use.

The easiest way is to restore from ADIF if you have backups up to date. How ever ADIF backup restores only qso information not all I.E. settings etc.

Before that you should move your ~/.config/cqrlog folder away (rename it).
cp -a ~/.config/cqrlog ~/.config/cqrlog_safe
du -s ~/.config/cqrlog ~/.config/cqrlog_safe
rm -rf ~/.config/cqrlog

First (cp) make copy to ~/.config/cqrlog_safe
second (du) check that copy and original sizes are equal
third (rm) remove original

You can also remove ~/.config/cqrlogB and /usr/bin/cqrlogB(this needs sudo) unless you like to keep them as second cqrlog.

After you have moved original ~/.config/cqrlog you can start cqrlog and it says you have not used it before (like the cqrlog B did) then make your selections and once log001 is created you can do adif import.

If you can restore you old setup of cqrlog and your mysql and get it running you can do database backup with mysldump. Put "mysqldump" to forum search box (top right) and you get several messages about it. Then switch to new cqrlog and do import with mysql command (mysql < dumpfile.sql)

Of course you can google with those error texts you have in mysql.err file and also with "reading mysql database with MariaDB" or something like that. If you can find a solution that way.

What ever you do make several copies of your original ~/.config/cqrlog folder before trying anything.

--
Saku
OH1KH

la3rk
Mariadb problem

Had cqrlog working on pevious version. Lost contact with database after upgrade to 2.5.Not sure if mariadb or mysql was before.

Will try to fix tonite.

73 de Olaf

Olaf Devik LA3RK

la3rk
MariaDB problem

Saku
Thanks for help. Cqrlog is up and running again. Seems I had some mixup with mysql which created these problems. Emptied cqrlog files as you indicated, restarted and loaded log from adi backup. Had to reset a number of settings, but having been down that road before not a big issue.
CqrlogB copy has been removed, there may of course be some data left in MariaDB which can be removed as Cqrlog probably remade all tables again. Will leave that for another time.

73 de Olaf - LA3RK

Olaf Devik LA3RK

oh1kh
MariaDB problem

Fine !
CqrlogB had all its data in ~/.config/cqrlogB . If that is away there is nothing remaining in MariaDB.

Now you should do setup export. Start cqrlog, but do not open log. if you have auto open last log take it away for a while.
At start in "Database Connection" window select your log (by click) from where you export settings. Then press "utils" and select "configuration" -> "export".
You can save your export to ~/.config/cqrlog folder with suitable name.

Then every time you make new log at "database connection" do not open it yet, select it by click (if not already selected). Then press "utils" and select "configuration" -> "import" and find your saved settings file. Then open the new log and it is OK right away from first start.

This saves lot of typing. If you install cqrlog to another computer you can copy settings file and use it to get all settings ok right away for the first log it creates.

--
Saku
OH1KH