# MySQL server doesn't run and hangs

## sasq

I've just emerged dev-db/mysql-5.1.67. Compiled successfully.

Then I ran emerge --config =dev-db/mysql-5.1.67, as suggested by the emerge messages.

I typed in my new admin password (twice), and the config tool hanged at this point:

```
Configuring pkg...

 * Please provide a password for the mysql 'root' user now, in the

 * MYSQL_ROOT_PASSWORD env var or through the /root/.my.cnf file.

 * Avoid ["'\_%] characters in the password

    >

 * Retype the password

    >

 * Command: '/usr/bin/mysql_install_db' '--basedir=/usr' --log-warnings=0 --user=mysql
```

After several minutes without any apparent action, I killed it and tried again. This time the message was:

```
Configuring pkg...

 * You have already a MySQL database in place.

 * (///var/lib/mysql/*)

 * Please rename or delete it if you wish to replace it.

 * ERROR: dev-db/mysql-5.1.67 failed (config phase):

 *   MySQL database already exists!

 * 

 * Call stack:

 *     ebuild.sh, line   93:  Called pkg_config

 *   environment, line 4030:  Called mysql-v2_pkg_config

 *   environment, line 3636:  Called die

 * The specific snippet of code:

 *           die "MySQL database already exists!";

 * 

 * If you need support, post the output of `emerge --info '=dev-db/mysql-5.1.67'`,

 * the complete build log and the output of `emerge -pqv '=dev-db/mysql-5.1.67'`.

 * This ebuild is from an overlay named 'gentoo': '/var/db/pkg/'

 * The complete build log is located at '/var/tmp/portage/dev-db/mysql-5.1.67/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.1.67/temp/environment'.

 * Working directory: '/var/tmp/portage/dev-db/mysql-5.1.67'

 * S: '/var/tmp/portage/dev-db/mysql-5.1.67/work/mysql-5.1.67'
```

so I assumed that the configuration has been done. Then I tried to run the server by /etc/init.d/mysql start, but it just hangs again:

```
* Caching service dependencies ...    [ ok ]

 * Starting mysql ...
```

I killed it and tried to run the mysqld daemon manually. But the result is the same: it just hangs, without any error messages.

I checked the logs, they were all empty.

What is wrong and how to repair it?

I've never had any such problems with MySQL in the past.

----------

## honp

Which logs did you check?

----------

## sasq

Every single one in /var/log/mysql/: mysqld.err, mysql.err, mysql.log. Every one was empty.

Strangely enough, after I killed that hanged process, deleted the installation and configured it once more, now everything works again  :Razz: 

So I don't have that problem any more, but it might be some bug in the installation, and others might have it too, so it's worth investigating.

----------

