# [SOLVED] mysql fail to start

## mayday147

My mysql fails to start without any error:

```

charlie mayday # /etc/init.d/mysql start

 * Starting service mysql

 MySQL NOT started (0)                                                                                                              [ !! ]

 * FAILED to start service mysql!

```

```

/var/log/mysql/mysqld.err is empty

/var/log/mysql/mysql.log is empty

/var/log/mysql/mysql.err is empty

/var/log/messages doesn't say anything about it

```

```

charlie mayday # mysql --version

mysql  Ver 14.12 Distrib 5.0.17, for pc-linux-gnu (i686) using readline 5.1

```

I mention that I did't modified the default /etc/mysql/my.conf file neither.

Where else should I look?

*edit* 

Despite all of this, it seems that mysqld is listening, but I can't connect to it:

```

charlie mayday # netstat -anp |grep 3306

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      13743/mysqld

charlie mayday # mysql -u root -p

Enter password: 

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

```

----------

## magic919

That's odd.  But I notice you have MySQL listening on a port but are trying to connect to it via a socket.  Try connecting to the port.  And check for the presence of the socket.

----------

## mayday147

 *magic919 wrote:*   

> Try connecting to the port.  And check for the presence of the socket.

 

How should I connect through a port?

And yes, the socket file exists. I read somewhere to check the permissions of this file. What would that permissions be?

----------

## magic919

Have a quick look at man mysql and you'll see  the options.

My own socket looks like this

```
srwxrwxrwx  1 mysql mysql 0 Dec 12 14:48 /var/run/mysqld/mysqld.sock
```

Do take a look at my.cnf as it will help you understand what is happening.  I'd also look in /etc/init.d/mysql.

I'd recommend killing the current instance, zapping the init script (/etc/init.d/mysql zap) and giving it another try.

----------

## mayday147

I tried that but it doesen't work. It only works if I start it manually 'mysqld --port=3306'

----------

## eleanor

Try:

```
/etc/init.d/mysqld start
```

----------

## mayday147

 *eleanor wrote:*   

> Try:
> 
> ```
> /etc/init.d/mysqld start
> ```
> ...

 

```

charlie # /etc/init.d/mysqld start

bash: /etc/init.d/mysqld: No such file or directory

```

----------

## mayday147

Now it doesn't starts at all. Not even by manually running mysqld. And the best part is that there is no logs.

----------

## magic919

This is tiresome.

I'd recommend making sure you don't have any instance of it running with ps -ef or whatever.

Take a read of /etc/init.d/mysql so you can see what it actually runs - it's not mysqld on mine, for example.

Take a look at /etc/mysql/my.cnf and see what is set.

Take a look at man mysql to see options available to help you troubleshoot.

Run it off the commandline and debug.

Seriously consider whether you should be sticking with MySQL 5 when it is proving to be such a pain.

----------

## mayday147

It seems that it was a bash issue. Emerging  '=app-shells/bash-3.0-r14' solved this. 

Many thanks for your answers,though.

----------

