This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Problem logging into embedded mysql database.

Tags: None
(comma "," separated)
phiwum
Registered Member
Posts
11
Karma
0
Hello,

I followed the instructions at https://community.kde.org/Amarok/Develo ... L_Embedded in order to log in to the Amarok database, but I hit an error. I stop my mysqld server and execute
Code: Select all
/usr/sbin/mysqld --defaults-file=`pwd`/my.cnf --default-storage-engine=MyISAM --datadir=`pwd`/mysqle --socket=`pwd`/sock --skip-grant-tables

in ~/.kde4/share/apps/amarok, but I get the following error message:
Code: Select all
mysqld: [ERROR] Could not open required defaults file: /home/jesse/.kde/share/apps/amarok/my.cnf
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!


Now, I'm not using MySQL 5.1.30, as recommended in that page. I have 5.7.18 installed. I would prefer not to install an older version for the little housekeeping I want to do. Has anyone had any luck using a more recent mysql to connect to the embedded DB?

Thanks.
wolfi323
Registered Member
Posts
1129
Karma
11
OS
phiwum wrote:
Code: Select all
mysqld: [ERROR] Could not open required defaults file: /home/jesse/.kde/share/apps/amarok/my.cnf


Seems that the my.cnf file doesn't exist.

Are you actually using Amarok with an embedded database, or did you configure it to use an external server?
I.e. what does this command say:
Code: Select all
grep UseServer ~/.kde/share/config/amarokrc


If you use an external server ("UseServer=true"), you can just connect to it and access the Amarok database like you would with any other database...
phiwum
Registered Member
Posts
11
Karma
0
wolfi323 wrote:
phiwum wrote:
Code: Select all
mysqld: [ERROR] Could not open required defaults file: /home/jesse/.kde/share/apps/amarok/my.cnf


Seems that the my.cnf file doesn't exist.


my.cnf *does* exist, is in the right place and is readable.

Code: Select all
[embedded]
datadir = /home/jesse/.kde/share/apps/amarok/mysqle
default-storage-engine = MyISAM
loose-innodb = 0
skip-grant-tables = 1
myisam-recover-options = FORCE
key_buffer_size = 16777216
character-set-server = utf8
collation-server = utf8_bin
language = /usr/share/kde4/apps/amarok/mysqle


Looks okay to me. The only possibly odd thing is that "[embedded]" looks like an opening tag, but there is no close tag. I presume that this is normal, however.

I suspect that there's a compatibility problem with newer versions of MySQL, but I'd sure rather not have to install a back version.

Are you actually using Amarok with an embedded database, or did you configure it to use an external server?
I.e. what does this command say:
Code: Select all
grep UseServer ~/.kde/share/config/amarokrc


If you use an external server ("UseServer=true"), you can just connect to it and access the Amarok database like you would with any other database...


I'm not using an external server.

Thanks for the help.
wolfi323
Registered Member
Posts
1129
Karma
11
OS
phiwum wrote:my.cnf *does* exist, is in the right place and is readable.

Hm, then it might indeed be an incompatibility with newer mysql versions. I cannot tell or check as I'm using mariadb since years (and an external server for Amarok).

Looks okay to me. The only possibly odd thing is that "[embedded]" looks like an opening tag, but there is no close tag. I presume that this is normal, however.

Yes, that's how a freshly generated my.cnf looks here too.
And "INI" style config files do not have closing tags.

You might try to just omit the --defaults-file=xxx parameter though I suppose, the other arguments should tell mysql the proper parameters for the embedded database anyway, as I see it.
phiwum
Registered Member
Posts
11
Karma
0
wolfi323 wrote:
phiwum wrote:my.cnf *does* exist, is in the right place and is readable.

Hm, then it might indeed be an incompatibility with newer mysql versions. I cannot tell or check as I'm using mariadb since years (and an external server for Amarok).

Looks okay to me. The only possibly odd thing is that "[embedded]" looks like an opening tag, but there is no close tag. I presume that this is normal, however.

Yes, that's how a freshly generated my.cnf looks here too.
And "INI" style config files do not have closing tags.

You might try to just omit the --defaults-file=xxx parameter though I suppose, the other arguments should tell mysql the proper parameters for the embedded database anyway, as I see it.


Thanks for the suggestion, but it seems that mysqld exits immediately after starting without the defaults-file option. There is no daemon running immediately after execution.

I may have to install an old mysql to get into the database. You can bet I'll migrate it to my main mysql server at that time.
wolfi323
Registered Member
Posts
1129
Karma
11
OS
I haven't noticed it before, but maybe try to remove that line from the my.cnf:
Code: Select all
language = /usr/share/kde4/apps/amarok/mysqle


I don't have that in the freshly generated one here, and I don't even have a mysqle folder in /usr/share/kde4/apps/amarok/ on my system (there's no mysqle folder at all in the amarok package).

No idea if that can be the problem though.
wolfi323
Registered Member
Posts
1129
Karma
11
OS
PS, just to rule out the obvious:
You did cd to the directory ~/.kde/share/apps/amarok/ before you ran the mysqld line, right?

I.e.:
Code: Select all
cd ~/.kde/share/apps/amarok
/usr/sbin/mysqld --defaults-file=`pwd`/my.cnf --default-storage-engine=MyISAM --datadir=`pwd`/mysqle --socket=`pwd`/sock --skip-grant-tables


If not it's clear that the my.cnf cannot be found because that command line expects it to be in the current directory.

(and yes, I do get exactly the same error message as you posted if I don't cd to the directory first)
phiwum
Registered Member
Posts
11
Karma
0
wolfi323 wrote:PS, just to rule out the obvious:
You did cd to the directory ~/.kde/share/apps/amarok/ before you ran the mysqld line, right?

I.e.:
Code: Select all
cd ~/.kde/share/apps/amarok
/usr/sbin/mysqld --defaults-file=`pwd`/my.cnf --default-storage-engine=MyISAM --datadir=`pwd`/mysqle --socket=`pwd`/sock --skip-grant-tables


If not it's clear that the my.cnf cannot be found because that command line expects it to be in the current directory.

(and yes, I do get exactly the same error message as you posted if I don't cd to the directory first)

It's never a bad idea to rule out the obvious, but yes, I'm in the right directory.
phiwum
Registered Member
Posts
11
Karma
0
wolfi323 wrote:I haven't noticed it before, but maybe try to remove that line from the my.cnf:
Code: Select all
language = /usr/share/kde4/apps/amarok/mysqle


I don't have that in the freshly generated one here, and I don't even have a mysqle folder in /usr/share/kde4/apps/amarok/ on my system (there's no mysqle folder at all in the amarok package).

No idea if that can be the problem though.


I appreciate the suggestion, but it doesn't seem to be the issue.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], Sogou [Bot], Yahoo [Bot]