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:

Hey AxelTerizaki, I have just joined the community about 2 hours ago, I’ve been trying to fix my issue of “Error connecting to database” by reinstalling KaraokeMugen (8.0.22) using the stable version, using the portable version, and using a newer version that was released today (8.0.37). Each version I have used for KaraokeMugen, it would give me the same error. And I am able to ping kara.moe. Would you happen to know any other ways to fix my issue?

Hello and thank you for using KM, and posting here for support!

I can’t really help without log files though. You’ll find the KM log in c:\users\your_user\appdata\roaming\karaokemugen-app\app\logs if I’m not mistaken. You can send them to me on Discord in DMs or here.

1 « J'aime »

Solved, the VC++ redistribuable wasn’t installed.

To install it : https://aka.ms/vs/17/release/vc_redist.x64.exe