MySQL database for music / Changing server and Upgrading MariaDB - errors in the log
#1
Recently I moved my MyMusic82 database from a raspberry pi running
  mariadb  Ver 15.1 Distrib 10.5.19-MariaDB

To a new server running,
mariadb  Ver 15.1 Distrib 10.6.12-MariaDB

I migrated the database by exporting the data with mysqldump, and reimporting it in the new server.

I repointed my kodi clients to the new MariaDB server, and I can see, browse and play my music with no issues.

However, I noticed that the "Recently Played" section in the interface is no longer showing (it used to show a list of the recently played albums) and also, when I display the music section, an error shows in the logs:

   error <general>: SQL: [MyMusic82] Undefined MySQL error: Code (1305)
   error <general>: GetAlbumsByWhereJSON failed

Sounds like the stored procedures did not get transferred up, and kodi is not re-creating them in the new server.
Doing some research, it seems my mysqldump command did not include the stored procedures. Is there a way to force kodi to re-create them without having to drop the database completely and losing my data?

p.s. I ran mysql_update -u root -ppassword in the new server, restarted mariadb and kodi, it didn't fix the problem, the errors in the log complaining about missing functions still persist

ps.2 also browsing the music DB by Genre is broken (genres are listed, but clicking in a genre procedures no result (when working, I could see the list of artists/albums that belong to the genre)
Reply
#2
In case anyone runs into this, here's how to recover all functions without losing the DB data (this assumes you have the DB data backed up in a mysqldump, without the stored procedures)

- stop kodi
- login into mysql and DROP DATABASE MyMusic82;
- start kodi
    this steps creates a blank database with the stored procedures. do not rescan your DB at this point - no music will show in your Music page in this step
- stop kodi
- reimport your DB data: mysql -uroot  MyMusic82 -p < ./MyMusic82.sql
- start kodi

problem solved
Reply
#3
As you discovered there is more to the music database than just data! Simply doing a data dump on MariaDB isn't enough, glad that you found a work around for yourself, letting Kodi create an empty database and then applying the SQL dump for the data is probably the easiest route to take.
Reply

Logout Mark Read Team Forum Stats Members Help
MySQL database for music / Changing server and Upgrading MariaDB - errors in the log0