Skip to content

Using MySQL instead of SQLite

Sam Stenvall edited this page Jul 11, 2019 · 1 revision

Advanced users may want to use MySQL instead of SQLite. This can be achieved fairly easily by manipulating some environment variables.

There are two ways to tell XBMC Video Server to use MySQL. Both ways are described below.

Using a .env file

This is the preferred way if you run the application normally according to the installation instructions (i.e. no fancy custom setup).

  1. Copy the .env.mysql.example file to .env. Modify the variables so they're correct for your installation.
  2. Create an empty database for XBMC Video Server, e.g. xbmc_video_server. The name can be whatever you want, just make sure you modify the MYSQL_DATABASE environment variable accordingly.

That's it, now you can run php ./src/protected/yiic.php createinitialdatabase to create the necessary database tables, and when you use the application it will use MySQL instead of SQLite.

Injecting environment variables by some other means

If you use e.g. Docker Compose, you might wanna specify the required environment variables in your docker-compose.yml instead of messing around with .env files. You can see which environment variables are required by looking at the .env.mysql.example file.