7

I've got a chroot environment working on my 10.04 ubuntu box. I'm trying to run mysql inside this chroot environment, but I get this error.

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

Basically I used debootstrap along with schroot to create the chroot. Then I installed "ubuntu-minimal" and mysql-server inside this chroot environment. If you are interested here are all the steps that I followed https://help.ubuntu.com/community/DebootstrapChroot . But mysql does not work inside the chroot. /var/log/mysql.log and /var/log/mysql.err files are empty and mysqld server is running. Any pointers?

2 Answers 2

4

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

http://ubuntuforums.org/showthread.php?t=1625863 https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/430224

1
  • And was this bug fixed? Is there a workaround? What to do about it?
    – erikbstack
    Commented Jul 21, 2015 at 11:46
1

make sure mysql have write permission. try running mysql as root. If it works fix the file permission so mysql have write permission and restart mysql as normal user. .

12
  • I am inside chroot as a root. So thats not a problem.
    – Neo
    Commented Feb 20, 2011 at 11:32
  • can you list the package you have installed for mysql and file permission of /var/run/mysqld/mysqld.sock
    – Vivek Goel
    Commented Feb 20, 2011 at 11:39
  • 1
    @neo, hopefully you aren't running mysqld inside the chroot as user root. (That would make any chroot security useless; running mysqld as root makes shivers run up my spine.)
    – sarnold
    Commented Feb 20, 2011 at 11:42
  • 1
    I simply installed apt-get install mysql-server in the chroot. And /var/run/mysqld directory is empty.
    – Neo
    Commented Feb 20, 2011 at 11:45
  • @sarnold - Yep, I'm doing it as root, but just for the time being. Atleast it should start working and then I can change the permissions.
    – Neo
    Commented Feb 20, 2011 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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