# Squeezeboxserver/Perl won't connect to MySQL

## Cygon

Hi!

For the past few months, I had squeezeboxserver (Perl) running on my Gentoo system without a hitch. I'm using MySQL for its database.

Today, I decided to do a reinstall of MySQL (including a complete dump, erase and restore) to clean out old stuff and obtain updates to defaults in the privileges table that aren't applied by mysql_upgrade. Some wuss once said "never change a running system", but clearly that wouldn't apply to me  :Very Happy: 

What do you think, *of course* it broke down. When I start squeezeboxserver, the logs now show this:

 *Quote:*   

> [11-02-10 11:04:52.9154] main::init (323) Starting Squeezebox Server (v7.5.2, r31632, Mon Dec 13 14:08:06 MST 2010) perl 5.012003
> 
> [11-02-10 11:04:53.1520] Slim::Schema::Storage::throw_exception (82) Error: DBI Connection failed: DBI connect('database=squeezeboxserver;mysql_socket=/var/run/mysqld/mysqld.sock','squeezeboxserver',...) failed: Access denied for user 'squeezeboxserver'@'localhost' (using password: YES)[/quote

 

The error is the exact wording one gets when he tries to connect to MySQL with a wrong password or username.

However, I have restored the database in MySQL and granted all rights on the database to the user 'squeezeboxserver', then added the new password into /etc/squeezeboxserver/squeezeboxserver.prefs. Using copy & paste to take the password and launching the mysql client application with it works fine:

```
# mysql squeezeboxserver -u squeezeboxserver -p

Enter password:

Reading table information for completion of table and column names

[...]

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
```

Any ideas?

----------

## albright

you could try to run "emerge --config squeezeboxserver" (or

whatever the exact command it) to re-setup the mysql

database stuff.

----------

## Cygon

One observation I made was that the password is stored in two files:

```
/etc/squeezeboxserver/squeezeboxserver.prefs

/etc/squeezeboxserver/prefs/server.prefs
```

The former is where the squeezeboxserver HOWTO has you enter your DB password, the latter is what it's using once squeezeboxserver has created the database schema. However, even with the new password in both places, the error remained.

In the end I just dropped the database and re-emerged squeezeboxserver (is a --config squeezeboxserver part of a normal emerge? is guess yes), after which it started up normally again (though I had to set it up from scratch).

----------

