Error during connection to database... MySQL error

2 posts / 0 new
Last post
KC3SWL
KC3SWL's picture
Error during connection to database... MySQL error

I loaded a drive with FreeBSD and got the cqrlog port and installed. it starts up just fine then throws the MySQL errors out. from mysql.err file :::
2025-05-14T23:23:45.6NZ mysqld_safe Logging to '/home/Chris/.config/cqrlog/database/mysql.err'.
2025-05-14T23:23:45.6NZ mysqld_safe Starting mysqld daemon with databases from /home/Chris/.config/cqrlog/database
2025-05-14T23:23:45.902103Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.41) starting as process 10667
2025-05-14T23:23:45.904120Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2025-05-14T23:23:45.904133Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2025-05-14T23:23:45.912184Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2025-05-14T23:23:45.912429Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-05-14T23:23:45.912472Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-05-14T23:23:45.912847Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.41) Source distribution.
2025-05-14T23:23:45.6NZ mysqld_safe mysqld from pid file /home/Chris/.config/cqrlog/database/bitch.pid ended
2025-05-14T23:24:35.6NZ mysqld_safe Logging to '/home/Chris/.config/cqrlog/database/mysql.err'.
2025-05-14T23:24:35.6NZ mysqld_safe Starting mysqld daemon with databases from /home/Chris/.config/cqrlog/database
2025-05-14T23:24:35.964556Z 0 [System] [MY-010116] [Server] /usr/local/libexec/mysqld (mysqld 8.0.41) starting as process 10990
2025-05-14T23:24:35.966086Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2025-05-14T23:24:35.966105Z 0 [Warning] [MY-013244] [Server] --collation-server: 'utf8mb3_bin' is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2025-05-14T23:24:35.974194Z 1 [ERROR] [MY-011011] [Server] Failed to find valid data directory.
2025-05-14T23:24:35.974454Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-05-14T23:24:35.974503Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-05-14T23:24:35.974867Z 0 [System] [MY-010910] [Server] /usr/local/libexec/mysqld: Shutdown complete (mysqld 8.0.41) Source distribution.
2025-05-14T23:24:35.6NZ mysqld_safe mysqld from pid file /home/Chris/.config/cqrlog/database/bitch.pid ended

from terminal when I run with debug :::
Chris@bitch:~ $ cqrlog --debug=1

Cqrlog Ver:2.5.2 (001) Date:2021-02-12
**** DEBUG LEVEL 1 ****

OS:
FreeBSD 14.2-RELEASE amd64
SSL libraries:
libssl.so
libcrypto.so
Loaded 134350 LoTW users
Loaded 125829 eQSL users
Loaded 36919 SCP calls
*
User home directory: /home/Chris/
Program home directory: /home/Chris/.config/cqrlog/
Data directory: /home/Chris/.config/cqrlog/database/
Memebers directory: /home/Chris/.config/cqrlog/members/
ZIP code directory: /usr/local/share/cqrlog/zipcodes/
Binary dir:
Share dir: /usr/local/share/cqrlog/
*
56 us states loaded
Grid map created
mysqld
MySQLProcess.Executable: /usr/local/bin/mysqld_safe Parameters: --defaults-file=/home/Chris/.config/cqrlog/database/mysql.cnf
--datadir=/home/Chris/.config/cqrlog/database/
--socket=/home/Chris/.config/cqrlog/database/sock
--port=64000

Trying to connect to database
2025-05-14T23:33:47.6NZ mysqld_safe Logging to '/home/Chris/.config/cqrlog/database/mysql.err'.
2025-05-14T23:33:47.6NZ mysqld_safe Starting mysqld daemon with databases from /home/Chris/.config/cqrlog/database
2025-05-14T23:33:47.6NZ mysqld_safe mysqld from pid file /home/Chris/.config/cqrlog/database/bitch.pid ended
TMySQL57Connection : Server connect failed.
Trying:1
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:2
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:3
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:4
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:5
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:6
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:7
Trying to connect to database
TMySQL57Connection : Server connect failed.
Trying:8

I thought if I ditch mysql and put in mariadb that would work.. but the installer insists on mysql. I had a standalone folder with cqrlog but it too throws the same error .
Thanks for any help !
Chris

oh1kh
Error during connection to database... MySQL error

HI Chris!
The problem is mysqld 8.0.41.
After Cqrlog is installed you should replace Mysql with MariaDB.

If you can not do that you could try to use existing sql server at port 3306. It is there if you have Mysql or MariaDB installed.
You just have to create a mysql user with password and grant all privileges to databases starting with cqr% (or *.* if you do not have other databases running on PC)

From command console start mysql using sudo:

sudo mysql

At mysql prompt give following commands:

CREATE USER IF NOT EXISTS 'cqrlog'@'localhost' IDENTIFIED BY 'cqrlog';
GRANT ALL PRIVILEGES ON *.* TO 'cqrlog'@'localhost';
FLUSH PRIVILEGES;
QUIT

You can change password after "IDENTIFIED BY" if you wish.

After that has succeeded remove ~/.config/cqrlog folder (you should have no logs there.(they all are deleted). But with clean install it should be OK)

Start cqrlog and do NOT  "save log data to local machine".
Fill "server name","port","user name"and password (will be: cqrlog with above commands).
Check "Remember me" and "Auto connect" and press "Connect"
You should get connected to mysql server and first log will be created.

Now logs will be in local machine, but not in ~/.config/cqrlog folder. That is why you have to do complete backup diffrerent way.

Copy ~/.config/cqrlog folder to safe place.

Usually that is enough, but now when using sql server at port 3306 you need to do additional dump from database.

Here is a bash script for doing that:


#!/bin/bash

stamp=$(date +_%Y%m%d-%H%M)
echo -e "\nStarted$stamp"
echo -e "Creating common backup of all CQRLOG logs in database to /tmp/allcqrlogs$stamp.sql"
$(mysql -ucqrlog -pcqrlog -B -N -hlocalhost -P3306 -e " show databases like 'cqr%'" |\
xargs  echo -n mysqldump -q -hlocalhost -P3306 -ucqrlog -pcqrlog --databases) > /tmp/allcqrlogs$stamp.sql
echo -e "Creating separate backups of each CQRLOG logXXX in database to /tmp/cqrlogXXX$stamp.sql(s)\n"
mysql -ucqrlog -pcqrlog -B -N -hlocalhost -P3306 -e " show databases like 'cqr%'" |\
xargs -d\ | while read line; do if [[ $line != "" ]];then\
echo "mysqldump -q -hlocalhost -P3306 -ucqrlog -pcqrlog $line > /tmp/$line$stamp.sql";fi;done > /tmp/sepsql.sh
chmod a+x /tmp/sepsql.sh
/tmp/sepsql.sh
rm /tmp/sepsql.sh
echo -e "\nDone!\nCopy backup files to your safe place.\nThey will be erased from /tmp at next Linux start\n\n"
echo "To restore all CQRLOG logs use command:"
echo -e "mysql -hlocalhost -P3306 -ucqrlog -pcqrlog < /tmp/allcqrlogs$stamp.sql\n\n"
echo "To restore single a log use command:"
echo "mysql -hlocalhost -P3306 -ucqrlog -pcqrlog cqrlog001 < /tmp/cqrlog001$stamp.sql"
echo -e "\nBe sure that both log numbers used in line are equal"


If you have choosen other password than "cqrlog" then change all "-pcqrlog" from script to correspond your password 

--
Saku
OH1KH