I think I've given this a fair attempt, so it's time to ask for some help.
TApplication.HandleException TMySQL57Connection : Error executing query: Can't create database 'cqrlog_common' (errno: 15195552)
I've tried local, remote, manually (but not carefully) creating the database, creating a gqrx mysql user, logging in ad the db root user, grepping the source for the error, googling for the error. Nothing.
If anyone has any tips about what's mis-configured I'd be grateful to hear them.
Cheers,
ZL1FAT
Logs and distro info:
cqrlog --debug=1
**** DEBUG LEVEL 1 ****
Loading libssl: /usr/lib/x86_64-linux-gnu/libssl.so
Loading libcrypto: /usr/lib/x86_64-linux-gnu/libcrypto.so
Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmysqlclient.so
**************************
MySQL version: 5.7
**************************
**********************************
MySQL version assigned: 5.7
**********************************
Loaded 93636 LoTW users
Loaded 98114 eQSL users
Loaded 48268 SCP calls
*
User home directory: /home/aaron/
Program home directory: /home/aaron/.config/cqrlog/
Data directory: /home/aaron/.config/cqrlog/database/
Memebers directory: /usr/share/cqrlog/members/
ZIP code directory: /usr/share/cqrlog/zipcodes/
Binary dir: /usr/bin/
Share dir: /usr/share/cqrlog/
TConnection to MySQL: 5.7
*
56 us states loaded
select * from tables where table_schema = 'cqrlog_common'
CREATE DATABASE cqrlog_common DEFAULT CHARACTER SET = utf8 DEFAULT COLLATE = utf8_bin;
USE cqrlog_common;
CREATE TABLE bands (
id_bands INT AUTO_INCREMENT PRIMARY KEY,
band VARCHAR(10) DEFAULT '',
b_begin NUMERIC(10,4),
b_end NUMERIC(10,4),
cw NUMERIC(10,4),
rtty NUMERIC(10,4),
ssb NUMERIC(10,4),
rx_offset numeric(10,4) default 0,
tx_offset numeric(10,4) default 0
);
CREATE INDEX band ON bands(band);
CREATE TABLE dxclusters (
id_dxclusters INT AUTO_INCREMENT PRIMARY KEY,
description VARCHAR(100) DEFAULT '',
address VARCHAR(100) DEFAULT '',
port VARCHAR(10) DEFAULT '',
dxcuser VARCHAR(12) DEFAULT '',
dxcpass VARCHAR(20) DEFAULT ''
);
CREATE INDEX description ON dxclusters(description);
CREATE TABLE iota_list (
id_iota_list INT AUTO_INCREMENT PRIMARY KEY,
iota_nr VARCHAR(6) DEFAULT '',
island_name VARCHAR(250) DEFAULT '',
dxcc_ref VARCHAR(15) DEFAULT '',
pref VARCHAR(15) DEFAULT ''
);
CREATE INDEX iota_nr ON iota_list(iota_nr);
CREATE INDEX pref ON iota_list(pref);
CREATE TABLE dxcc_ref (
id_dxcc_ref INT AUTO_INCREMENT PRIMARY KEY,
pref VARCHAR(20) NOT NULL,
name VARCHAR(100) NOT NULL,
cont VARCHAR(6) NOT NULL,
utc VARCHAR(12)NOT NULL,
lat VARCHAR(10) NOT NULL,
longit VARCHAR(10) NOT NULL,
itu VARCHAR(20) NOT NULL,
waz VARCHAR(20) NOT NULL,
adif SMALLINT NOT NULL DEFAULT 0,
deleted SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX pref ON dxcc_ref(pref);
CREATE INDEX adif ON dxcc_ref(adif);
CREATE TABLE qslmgr (
id_qslmgr INT AUTO_INCREMENT PRIMARY KEY,
callsign VARCHAR(20),
qsl_via VARCHAR(20),
fromdate DATE
);
CREATE INDEX callsign ON qslmgr(callsign);
CREATE INDEX fromdate ON qslmgr(fromdate);
CREATE TABLE log_list (
id_log_list INT AUTO_INCREMENT PRIMARY KEY,
log_nr SMALLINT NOT NULL,
log_name VARCHAR(50) DEFAULT '',
auto_open SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX log_nr ON log_list(log_nr);
CREATE TABLE db_version
(
nr SMALLINT NOT NULL
);
TApplication.HandleException TMySQL57Connection : Error executing query: Can't create database 'cqrlog_common' (errno: 15195552)
Stack trace:
$00000000008D2E8F
$00000000008D4568
$000000000073DA0A
$000000000073E253
$000000000073D8F5
$0000000000430E8F
$0000000000706ED4
$00000000007D8252
$00000000007E9ED1
mysql -uroot -p"***"
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 177
Server version: 5.7.16-0ubuntu0.16.04.1 (Ubuntu)
uname -a
Linux akl008-ubuntu 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"
From what place did you copied the SQL command, please? I have to look at CQRLOG source code because maybe problem is with this:
CREATE TABLE db_version
(
nr SMALLINT NOT NULL
);
because there is no default value. You can try to modify the command to:
CREATE TABLE db_version
(
nr SMALLINT NOT NULL default 1
);
It should work even without the default value but MySQL is getting strict a bit.
73 Petr, OK2CQR
--
http://HamQTH.com/ok2cqr
https://ok2cqr.com
The command(s) I copied were from the debug output.
I subsequently found https://www.cqrlog.com/help/sql_console.html, and src/dData.pas but I was getting frustrated by then, and I don't know enough SQL to really work through what was happening. I don't really have the inclination to install your build environment, but I will try creating databases using the code from the link above and your tip about the version default.
I will report the results shortly.
It appears I misunderstood what the error was showing. There is no database created, so it never occurred to me that the last bit of SQL shown was causing the error.
Forgot to say:
Thanks for getting back to me. Your support is appreciated :)
Maybe I will install the build environment. By all accounts this is the best logging environment for linux.
I am not seeing how this can work:
procedure TdmData.CheckForDatabases;
var
Exists : Boolean = False;
begin
if trmQ.Active then
trmQ.Rollback;
mQ.SQL.Clear;
mQ.SQL.Text := 'select * from tables where table_schema = '+
QuotedStr('cqrlog_common');
trmQ.StartTransaction;
mQ.Open;
if mQ.RecordCount > 0 then
Exists := True;
----
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 428
Server version: 5.7.16-0ubuntu0.16.04.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select * from tables;
ERROR 1046 (3D000): No database selected
mysql> use cqrlog_common
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from tables;
ERROR 1146 (42S02): Table 'cqrlog_common.tables' doesn't exist
mysql>
OK. That wasn't it. I'll try some other things if I get around to it later today.
./cqrlog --debug=1
**** DEBUG LEVEL 1 ****
Loading libssl: /usr/lib/x86_64-linux-gnu/libssl.so
Loading libcrypto: /usr/lib/x86_64-linux-gnu/libcrypto.so
Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmysqlclient.so
**************************
MySQL version: 5.7
**************************
**********************************
MySQL version assigned: 5.7
**********************************
Ctyfiles dir: /home/aaron/cqrlog/usr/share/cqrlog/ctyfiles/
Local ctyfiles dir: /home/aaron/.config/cqrlog/ctyfiles/
Loaded 93636 LoTW users
Loaded 98114 eQSL users
Loaded 48268 SCP calls
*
User home directory: /home/aaron/
Program home directory: /home/aaron/.config/cqrlog/
Data directory: /home/aaron/.config/cqrlog/database/
Memebers directory: /home/aaron/cqrlog/usr/share/cqrlog/members/
ZIP code directory: /home/aaron/cqrlog/usr/share/cqrlog/zipcodes/
Binary dir: /home/aaron/cqrlog/usr/bin/
Share dir: /home/aaron/cqrlog/usr/share/cqrlog/
TConnection to MySQL: 5.7
*
56 us states loaded
/usr/sbin/mysqld --defaults-file=/home/aaron/.config/cqrlog/database/mysql.cnf --datadir=/home/aaron/.config/cqrlog/database/ --socket=/home/aaron/.config/cqrlog/database/sock --port=64000
select * from tables where table_schema = 'cqrlog_common'
CREATE DATABASE cqrlog_common DEFAULT CHARACTER SET = utf8 DEFAULT COLLATE = utf8_bin;
USE cqrlog_common;
CREATE TABLE bands (
id_bands INT AUTO_INCREMENT PRIMARY KEY,
band VARCHAR(10) DEFAULT '',
b_begin NUMERIC(10,4),
b_end NUMERIC(10,4),
cw NUMERIC(10,4),
rtty NUMERIC(10,4),
ssb NUMERIC(10,4),
rx_offset numeric(10,4) default 0,
tx_offset numeric(10,4) default 0
);
CREATE INDEX band ON bands(band);
CREATE TABLE dxclusters (
id_dxclusters INT AUTO_INCREMENT PRIMARY KEY,
description VARCHAR(100) DEFAULT '',
address VARCHAR(100) DEFAULT '',
port VARCHAR(10) DEFAULT '',
dxcuser VARCHAR(12) DEFAULT '',
dxcpass VARCHAR(20) DEFAULT ''
);
CREATE INDEX description ON dxclusters(description);
CREATE TABLE iota_list (
id_iota_list INT AUTO_INCREMENT PRIMARY KEY,
iota_nr VARCHAR(6) DEFAULT '',
island_name VARCHAR(250) DEFAULT '',
dxcc_ref VARCHAR(15) DEFAULT '',
pref VARCHAR(15) DEFAULT ''
);
CREATE INDEX iota_nr ON iota_list(iota_nr);
CREATE INDEX pref ON iota_list(pref);
CREATE TABLE dxcc_ref (
id_dxcc_ref INT AUTO_INCREMENT PRIMARY KEY,
pref VARCHAR(20) NOT NULL,
name VARCHAR(100) NOT NULL,
cont VARCHAR(6) NOT NULL,
utc VARCHAR(12)NOT NULL,
lat VARCHAR(10) NOT NULL,
longit VARCHAR(10) NOT NULL,
itu VARCHAR(20) NOT NULL,
waz VARCHAR(20) NOT NULL,
adif SMALLINT NOT NULL DEFAULT 0,
deleted SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX pref ON dxcc_ref(pref);
CREATE INDEX adif ON dxcc_ref(adif);
CREATE TABLE qslmgr (
id_qslmgr INT AUTO_INCREMENT PRIMARY KEY,
callsign VARCHAR(20),
qsl_via VARCHAR(20),
fromdate DATE
);
CREATE INDEX callsign ON qslmgr(callsign);
CREATE INDEX fromdate ON qslmgr(fromdate);
CREATE TABLE log_list (
id_log_list INT AUTO_INCREMENT PRIMARY KEY,
log_nr SMALLINT NOT NULL,
log_name VARCHAR(50) DEFAULT '',
auto_open SMALLINT NOT NULL DEFAULT 0
);
CREATE INDEX log_nr ON log_list(log_nr);
CREATE TABLE db_version
(
nr SMALLINT NOT NULL DEFAULT 1
);
TApplication.HandleException TMySQL57Connection : Error executing query: Can't create database 'cqrlog_common' (errno: 15195552)
Stack trace:
$00000000008D2E6F
$00000000008D4548
$000000000073D9EA
$000000000073E233
$0000000000599775
$00000000007B3E79
$00000000007A5963
$00007FF7C3B24AC3
Closing rigs...
select count(*) from .cqrlog_config
TApplication.HandleException TMySQL57Connection : Error executing query: Unknown table 'cqrlog_config' in information_schema
Stack trace:
$00000000008D2E6F
$00000000008D4548
$000000000044F49C
$00000000004E5ABD
$00000000007B660D
$00000000004E2D7F
$000000000073D9EA
$000000000073E233
$000000000073D8D5
$0000000000430E8F
$0000000000706EB4
$00000000007D8232
$00000000007E9EB1
Closing DXCluster window
Closing TRXControl window
Closing GrayLine window
Closing dDXCC
Deleting config file: cqrlog.cfg
Closing dData
WARNING: TLCLComponent.Destroy with LCLRefCount>0. Hint: Maybe the component is processing an event?
Closing ini file ...
Well, after an accidental reboot, using local data seems to be working.
Perhaps it was the lack of a default value after all.