mysqld: [ERROR] Could not open required defaults file: mysql.cnf

9 posts / 0 new
Last post
kc2jav
mysqld: [ERROR] Could not open required defaults file: mysql.cnf

I have a new install of Linux Mint 19 (within the last two months), installed mysql and "Adminer" database manager to verify that mysql is working with my "normal" userid. When I run cqrlog debug=1 I get the following output:

**** DEBUG LEVEL 1 ****

SSL libraries:
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18.0.0
**************************
MySQL version: 10.
**************************
**********************************
MySQL version assigned: 5.6
**********************************
Loaded 93636 LoTW users
Loaded 98114 eQSL users
Loaded 48268 SCP calls
*
User home directory: /home/bob/
Program home directory: /home/bob/.config/cqrlog/
Data directory: /home/bob/.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.6
*
56 us states loaded
/usr/sbin/mysqld --defaults-file=/home/bob/.config/cqrlog/database/mysql.cnf --datadir=/home/bob/.config/cqrlog/database/ --socket=/home/bob/.config/cqrlog/database/sock --port=64000
Trying to connect to database
mysqld: [ERROR] Could not open required defaults file: /home/bob/.config/cqrlog/database/mysql.cnf
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
TMySQL56Connection : Server connect failed.
Trying:1
Trying to connect to database
TMySQL56Connection : Server connect failed.
Trying:2
... etc.

I tried deleting the mysql.cnf file from the database folder, and when I run cqrlog debug=1 with no config file, it reappears during execution but is still unable to be opened from the very same folder in which it was written by cqrlog.

Please help!

kc2jav
Installation problem resolved - still have DB connection issues

After executing the following to more properly install cqrlog ...

sudo add-apt-repository ppa:ok2cqr/ppa;sudo apt-get update;sudo apt-get install cqrlog

I now have other files in the database folder including a mysql.err file (attached). Still in need of assistance.

Bob KC2JAV

File: 

oh1kh
Installation problem resolved - still have DB connection issues

Hi Bob!

I'm not mysql expert but I suggest:

1) rename folder ~./config/cqrlog to ~./config/cqrlog_bak
And then try to start again as " never used before". It may help if you currently have remaining files from previous install/test.

2) If that does not help rename folder (or delete) again. Read this message and try to start in same way: https://www.cqrlog.com/comment/6776#comment-6776

Does that work?

--
Saku
OH1KH

kc2jav
I renamed ~/.config/cqrlog to

I renamed ~/.config/cqrlog to ~/.config/cqrlog_bak and had the same exoerience as before. Then I ran the mysql command referenced in the 2) link above and now running cqrlog as "never used before" in debug mode I get the following:


Cqrlog Ver:2.3.0 (001) Date:2018-06-17
**** DEBUG LEVEL 1 ****

SSL libraries:
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18.0.0
**************************
MySQL version: 10.
**************************
**********************************
MySQL version assigned: 5.6
**********************************

Ctyfiles dir: /usr/share/cqrlog/ctyfiles/
Local ctyfiles dir: /home/bob/.config/cqrlog/ctyfiles/
Loaded 118377 LoTW users
Loaded 115544 eQSL users
Loaded 40133 SCP calls
*
User home directory: /home/bob/
Program home directory: /home/bob/.config/cqrlog/
Data directory: /home/bob/.config/cqrlog/database/
Memebers directory: /home/bob/.config/cqrlog/members/
ZIP code directory: /usr/share/cqrlog/zipcodes/
Binary dir: /usr/bin/
Share dir: /usr/share/cqrlog/
TConnection to MySQL: 5.6
*
56 us states loaded
/usr/sbin/mysqld --defaults-file=/home/bob/.config/cqrlog/database/mysql.cnf --datadir=/home/bob/.config/cqrlog/database/ --socket=/home/bob/.config/cqrlog/database/sock --port=64000
Trying to connect to database
TMySQL56Connection can not work with the installed MySQL client version: Expected (5.6), got (5.7.24).
Trying:1
Trying to connect to database
TMySQL56Connection can not work with the installed MySQL client version: Expected (5.6), got (5.7.24).
Trying:2
<\code>

So it appears that mysql client versions above 5.6 will not work?

oh1kh
I renamed ~/.config/cqrlog to

Hi!
Just checked source (my delvel, but this part is same in official 2.3.0-001) it uses mysql57connection. So it should work.
Do you happen to have 2 mysqls installed? Or MariaDB and mysql ?

What you said:
"Then I ran the mysql command referenced in the 2) link above and now running cqrlog as "never used before" in debug mode I get the following:"

If you issued the "GRANT ALL PRIVILEGES" command in mysq console (that is said in linked message) you did not start cqrlog in proper way as I can see from debug dump:
"usr/sbin/mysqld --defaults-file=/home/bob/.config/cqrlog/database/mysql.cnf --datadir=/home/bob/.config/cqrlog/database/ --socket=/home/bob/.config/cqrlog/database/sock --port=64000 "

Linked message says that after issuing the GRANT ALL PRIVILEGES-command in mysql cqrlog should be started so that port is 3306 and "save data to local machine" is unchecked in "Open databases" dialog window. See picture.

Then cqrlog does not try to create own protected database to ~./config/cqrlog/database but uses mysql server that is running in background already.
I do not know if it helps, but with some cases it seems to give easier start for cqrlog use.

1) Try to clear out do you have 2 versions of mysql (or Maridb) installed. And if so, remove the older version

2) Try again the "2)-suggest" of my previous message. Read the linked message carefully. It is for NanoPI, but same procedure works with "real PCs, too"

File: 

--
Saku
OH1KH

kc2jav
Hi Saku! Thank you for the

Hi Saku! Thank you for the feedback - I have made progress but still get an error:

1. I verified that I only have one mysql version installed -

bob@bob-Aspire-ES1-512:~$ dpkg -l mysql-client
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================================-===============================-===============================-================================================================================================================
ii mysql-client 5.7.23-0ubuntu0.18.04.1 all MySQL database client (metapackage depending on the latest version)
bob@bob-Aspire-ES1-512:~$ dpkg -l mysql-server
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================================-===============================-===============================-================================================================================================================
ii mysql-server 5.7.23-0ubuntu0.18.04.1 all MySQL database server (metapackage depending on the latest version)
bob@bob-Aspire-ES1-512:~$ dpkg -l mariadb
dpkg-query: no packages found matching mariadb
bob@bob-Aspire-ES1-512:~$ dpkg -l Mariadb
dpkg-query: no packages found matching Mariadb
bob@bob-Aspire-ES1-512:~$ dpkg -l MariaDB
dpkg-query: no packages found matching MariaDB
bob@bob-Aspire-ES1-512:~$

2. I repeated a fresh run of cqrlog -debug=1 with the following console output:

Cqrlog Ver:2.3.0 (001) Date:2018-06-17
**** DEBUG LEVEL 1 ****

SSL libraries:
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18.0.0
**************************
MySQL version: 10.
**************************
**********************************
MySQL version assigned: 5.6
**********************************

Ctyfiles dir: /usr/share/cqrlog/ctyfiles/
Local ctyfiles dir: /home/bob/.config/cqrlog/ctyfiles/
Loaded 118377 LoTW users
Loaded 115544 eQSL users
Loaded 40133 SCP calls
*
User home directory: /home/bob/
Program home directory: /home/bob/.config/cqrlog/
Data directory: /home/bob/.config/cqrlog/database/
Memebers directory: /home/bob/.config/cqrlog/members/
ZIP code directory: /usr/share/cqrlog/zipcodes/
Binary dir: /usr/bin/
Share dir: /usr/share/cqrlog/
TConnection to MySQL: 5.6
*
56 us states loaded

... and I made sure to answer "NO" to saving data to local machine, changed the port in the Database connection dialog to 3306 (I had to paste it, as for some reason when I typed from the keyboard each number was doubled, e.g. 33330066), made sure that "Save log data to local machine" was unchecked. MySQL client version 5.6 is still expected and I get an error when clicking on "Connect." See screenshot ...

File: 

oh1kh
I renamed ~/.config/cqrlog to

Hi
Do you also have mysqlclient-dev installed?

--
Saku
OH1KH

kc2jav
I tried this:

I tried this:
bob@bob-Aspire-ES1-512:~$ dpkg -l mysqlclient-dev
dpkg-query: no packages found matching mysqlclient-dev
bob@bob-Aspire-ES1-512:~$ sudo apt install mysqlclient-dev
[sudo] password for bob:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysqlclient-dev

... and when I googled for mysqlclient-dev the results pointed to "libmysqlclient-dev" - I'm guessing this is what you meant, so trying again ...


bob@bob-Aspire-ES1-512:~$ dpkg -l libmysqlclient-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================================-===============================-===============================-================================================================================================================
ii libmysqlclient-dev 5.7.24-0ubuntu0.18.04.1 amd64 MySQL database development files

Yes - "libmysqlclient-dev" is installed.

Bob
KC2JAV

oh1kh
I tried this:

Hi!

First the double key strokes when trying type 3306. See this thread: https://www.cqrlog.com/node/2064

From your debug dump I can see: Loading libmysqlclient: /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18.0.0
I found this using google: http://lists.lazarus.freepascal.org/pipermail/lazarus/2016-December/2306...

It seems to be similar problem just version numbers are different.

I'm quite out of ideas. I have never had mysql problems with Fedora. It seems to be very common with Ubuntu according to message chains in this forum.

--
Saku
OH1KH