# MySQL server refuses to start in jail



## volatilevoid (Jan 22, 2010)

Hi,

I installed the mysql55-server port in my jail and executed mysql_install_db. No problem so far. However, if I try to start the server with `# /usr/local/etc/rc.d/mysql-server start`, it simply says 
	
	



```
Starting mysql.
```
 and doesn't give me any error message, but when using mysqladmin or starting the CLI, MySQL complains that /tmp/mysql.sock isn't there - which indeed isn't.

My /tmp is a symlink to /s/tmp and I already tried `# chmod 1777 <dir>` on both /tmp and /s/tmp but I think that doesn't work with symlinks as `# ls` still shows 
	
	



```
lrwxr-xr-x
```
 for /tmp.

Any suggestion on this issue? TIA.

Thomas


----------



## User23 (Jan 22, 2010)

Check the owner of the /var/db/mysql directory and the files in it(or the directory u use)

User and group should be mysql.

greetz


----------



## volatilevoid (Jan 22, 2010)

Thanks a million! That fixed it.


----------



## User23 (Jan 22, 2010)

i got the same problem some days ago 

It is a pity that the mysql_install_db script doesnt not set the right permissions NOR the mysql start script check the permissions NOR the mysqlserver self gives you a message about ... just "Starting mysql." and nothing more.

Could be annoying


----------



## SirDice (Jan 22, 2010)

User23 said:
			
		

> It is a pity that the mysql_install_db script doesnt not set the right permissions NOR the mysql start script check the permissions NOR the mysqlserver self gives you a message about ... just "Starting mysql." and nothing more.



The "Starting mysql." is printed by the start script /usr/local/etc/rc.d/mysql-server.

The reason it prints nothing else is also in there:

```
command_args="--defaults-extra-file=${mysql_dbdir}/my.cnf --user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} ${mysql_args} > /dev/null 2>&1 &"
```

Note the redirection of STDOUT and STDERR to /dev/null 

The most obvious place to look for errors is the mysql error log.


----------



## volatilevoid (Jan 22, 2010)

I checked /var/db/mysql/<hostname>.err and there was no single word about file permissions inside, just a message that MySQL wasn't able to open and lock the privilege tables.


----------



## helplease (Feb 17, 2011)

What exact file permissions do I need to change? I am getting this same exact error but everything in my /var/db/mysql and the (three) files in it already are owned by mysql.


----------

