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

akonadi: DB initializer: "Unable to initialize database."

Tags: akonadi, database akonadi, database akonadi, database
(comma "," separated)
User avatar
thomasra
Registered Member
Posts
1
Karma
0
OS
Hello to all,

I have tried to connect akonadi do an external MariaDB running on an external server.
akonadiserver honors this with
Code: Select all
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: Running DB initializer
org.kde.pim.akonadiserver: "\nSql error: Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause QMYSQL: Unable to execute query\nQuery: CREATE TABLE PimItemTable (id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, rev INTEGER NOT NULL DEFAULT 0, remoteId VARBINARY(1024), remoteRevision VARBINARY(255), gid VARBINARY(255), collectionId BIGINT, mimeTypeId BIGINT, datetime TIMESTAMP DEFAULT CURRENT_TIMESTAMP, atime TIMESTAMP DEFAULT CURRENT_TIMESTAMP, dirty BOOL, size BIGINT NOT NULL DEFAULT 0, FOREIGN KEY (collectionId) REFERENCES CollectionTable(id) ON UPDATE CASCADE ON DELETE CASCADE, FOREIGN KEY (mimeTypeId) REFERENCES MimeTypeTable(id) ON UPDATE CASCADE ON DELETE RESTRICT)  COLLATE=utf8_general_ci DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC"
org.kde.pim.akonadiserver: Unable to initialize database.
org.kde.pim.akonadiserver: Failed to remove runtime connection config file
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...
This is correct to the extent that MariaDB really only allows "DEFAULT CURRENT_TIMESTAMP" in one column.
This is exactly my workaround: I issued a "CREATE TABLE" with "CURRENT_TIMESTAMP" in column "datetime". (Additionally I have changed the type "BOOL" to "BOOLEAN".)

Now my questions:
  • Is it even possible to do with only one "DEFAULT CURRENT_TIMESTAMP"?
  • Is it correct to drop it with "atime" or should I drop it with "datetime"?
  • Is there a more convenient way to connect a MariaDB?
???

My aconadiserverrc
Code: Select all
tom@pc-tom:~/.config/akonadi$ cat akonadiserverrc
[Debug]
Tracer=null

[%General]
Driver=QMYSQL

[QMYSQL]
Host=NAS-Speicher.fritz.box
Name=akonadi_tom
Options=
Password=ABC…
ServerPath=/usr/sbin/mysqld-akonadi
StartServer=false
User=akonadi_tom

My MariaDB:
  • Server-Version: 5.5.57-MariaDB
Thank you for reading!
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS
i could create a table with two TIMESTAMP columns using:
Code: Select all
...
t1 timestamp default now(),
t2 timestamp default now(),
...

The MariaDB version was:
Code: Select all
mysql> select version();
+-----------------+
| version()       |
+-----------------+
| 10.4.15-MariaDB |
+-----------------+


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, sandyvee