Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to run mysqld inside chroot environment. Herez the situation.

When I run mysqld as root, I can connect to my databases. But when I run mysql using init.d scripts, mysql gives me an error.

$ mysql --user=root --password=password
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

So I guess, I need to change file permissions of some files. But which ones? Oh and in case you are wondering '/var/run/mysqld/mysqld.sock' is owned by 'mysql' user.

EDIT: strace output looks something like this

[pid 20603] futex(0xf2cfc4, FUTEX_WAIT_PRIVATE, 685, NULL <unfinished ...>
[pid 20601] rt_sgtimedwait[HUP QUIT ALRM TERM TSTP], NULL, NULL, 8 <unfinished ...>
[pid 20600] futex(0xf2cfc4, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
[pid 20599] select(0, NULL, NULL, NULL, {0, 278651} <unfinished ...>
[pid 20598] select(0, NULL, NULL, NULL, {0, 42192} <unfinished ...>
[pid 20596] futex(0x21a72708, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
[pid 20595] futex(0x21a72690, FUTEX_WAIT_PRIVATE, 7, NULL <unfinished ...>
[pid 20594] futex(0x21a72618, FUTEX_WAIT_PRIVATE, 5, NULL <unfinished ...>
[pid 20593] futex(0x21a725a0, FUTEX_WAIT_PRIVATE, 1, NULL <unfinished ...>
[pid 20587] select(12, [10 12], NULL, NULL, NULL <unfinished ...>
[pid 20599] <... select resumed> )        = 0 (Timeout)
[pid 20599] time (NULL)                   = 12982215237
[pid 20599] select(0, NULL, NULL, NULL, {1, 0} <unfinished ...>
share|improve this question
up vote 0 down vote accepted

It is a bug with schroot. mysqld escapes chroot and interacts with systems's mysqld.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.