< Amarok‎ | Development
Revision as of 20:15, 28 October 2017 by Wscherer (talk | contribs) (missing --skip-networking option added. --socket option for client clarified)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Amarok/Development/MySQL Embedded

Why MySQL Embedded?

MySQL-embedded allows us to leverage the performance increase of a MySQL configuration, whilst alleviating non trivial configuration that comes with a standalone server.

Most noticeably, you will see much improved performance of collection scanning and searching, especially with very large music collections.

Eventually we also hope to be able to provide support for standalone MySQL servers.

Distribution specific instructions

Ubuntu 12.10 (Quantal)

  • Install package libmysqld-pic


  • Install mysql and mysql-client from [extra]
  • Amarok trunk should compile fine with MySQL Embedded support on i686 systems
  • Need confirmation for x86_64 systems. If you have problems, mysqle from AUR should work

openSUSE 11.0 / 11.1

  • Install libmysqlclient-devel
  • Amarok trunk should compile fine with MySQL Embedded support
  • Note that you may have to remove CMakeCache.txt from the build directory after installing libmysqlclient-devel for it to be recognized.

Fedora 10 (Rawhide)

  • Install mysql-embedded and mysql-embedded-devel (both located in the Fedora Rawhide repository)
  • Amarok trunk should compile fine with MySQL Embedded support

Compiling from source

Unfortunately mysql-embedded packages present in most of the existing distributions are not fit to be used with Amarok for the following reasons:

Also, there were some failures reported:

  • InnoDB does not start for lfranchi. But his configuration is too complex for me to contemplate. Perhaps this is a bug for Lenz/bugs.mysql.com


Download MySQL from here:

We've tested it against 5.1.30. The direct url is:

If you need 5.1.28-rc for some reason, you can get it from here: (limited offer!)

Compilation instructions

 tar xzvf mysql-5.1.28-rc.tar.gz
 cd mysql-5.1.28
 cp -R /path/to/amaroksource/supplementary_scripts/mysqle/* .
 export MAKEOPTS=-j2                                    # or more if you have many CPU cores
 ./build-mysqle.sh --prefix=${HOME}/usr
 then build Amarok like normal

If you install to a different prefix, you will have to set the CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH environment variables. For example, if you install to ~/amarok-build/mysql, you should do

 export CMAKE_LIBRARY_PATH=$HOME/amarok-build/mysql/lib:$CMAKE_LIBRARY_PATH
 export CMAKE_INCLUDE_PATH=$HOME/amarok-build/mysql/include:$CMAKE_INCLUDE_PATH

before running cmake on the Amarok sources. (Recommendation: add -DCMAKE_INCLUDE_PATH and -DCMAKE_LIBRARY_PATH as options to your cmake call for amarok compilation, do not forget to remove CMakeCache.txt before)

Pitfalls and common problems

  • Insufficient permissions
  • MySQL 5.0 vs 5.1
  • Qt compiled with -sql-mysql driver inside Qt itself makes amarok use libmysqlclient instead of libmysqld, which is a problem because it doesn't use mysql embedded then. Make sure your Qt does not have mysql driver "built-in" or at most compile it with mysql driver as a plugin.
  • build-mysqle.sh is not distributed in official tarballs, so if you want to use it, get it from SVN


Some tools like MySQL Administrator require a daemon to connect to. You can start such a daemon like this from your ~/.kde4/share/apps/amarok directory (--defaults-file MUST be the first option!):

/usr/sbin/mysqld --defaults-file=`pwd`/my.cnf --default-storage-engine=MyISAM --datadir=`pwd`/mysqle --skip-networking --socket=`pwd`/sock --skip-grant-tables

The skip-grant-tables means you can use any password or username to connect to it. Neither 'localhost' nor '' will work, the MySQL client must use a unix socket (still in directory ~/.kde4/share/apps/amarok):

mysql --socket=`pwd`/sock

To make opening the database on Windows easier you can create a bat file with these contents <notepad -> paste -> save (select save as 'all files') -> amarokmysqld.bat>:

mysqld --defaults-file=%appdata%\.kde\share\apps\amarok\my.cnf --default-storage-engine=MyISAM --datadir=%appdata%\.kde\share\apps\amarok\mysqle --skip-networking --socket=%appdata%\.kde\share\apps\amarok\sock --skip-grant-tables

Open the bat file now and your mysql-server should run. start mysql.exe now from a commandline client:

mysql.exe --socket=%appdata%\.kde\share\apps\amarok\sock

and you can access the database.

This page was last edited on 28 October 2017, at 20:15. Content is available under Creative Commons License SA 4.0 unless otherwise noted.