Error "Database initialization failed" / "Unable to connect to the database"

This error usually occurs the first time you start the app, but can occur upon subsequent starts.

If there is something you don’t understand, feel free to reply on this topic.

If this is the first time you’ve started the application

Something prevents the database system from starting with the app :

Windows

  • If your username contains an accent character like é à è, etc. you’ll need to install a Karaoke Mugen portable version. Karaoke Mugen doesn’t support accent characters in its path. To do so :
    • First uninstall the app
    • Remove the C:\Users\myusername\KaraokeMugen folder
    • Download a portable version from the Download page
    • Unzip it in a folder of your choice, like C:\KaraokeMugen, or on an external drive.
    • You can start the app from its folder.

Linux

PostgreSQL needs to be configured and launched prior to Karaoke Mugen’s launch when y ou use our Debian/Ubuntu packages. For more information, see this section from the documentation

If it worked before

There may be a problem with your database. We advise you reach to us on Discord with your log file ready.

But if you’re in a hurry and your database doesn’t contain anything valuable like custom playlists you spent hours on or stats you didn’t send to us via the stats upload prompt, you can safely erase the database and create a new one.

To do that :

  • Go to KM’s data directory:
    • Windows: c:\users\myuser\karaokemugen
    • Linux & Mac: ~/KaraokeMugen
  • Go into the db directory
  • Rename the postgresql directory to something else, like postgres.old
  • Restart Karaoke Mugen, this will trigger a new database initialization.

@AxelTerizaki dead link for the docs, new page is Installation :: Karaoke Mugen Documentation

I fixed that, thank you :slight_smile: