Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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've seen many questions about how to run multiple sql servers on one server, but I would like to run mysqld as a user-level process and completely self contained in a folder (I have no permissions outside my user folder).

I spent some time using the --defaults-file=my.cnf, but it still seems to conflict with the system-level mysql server that's running.

Does anybody know how to do this?

share|improve this question
up vote 1 down vote accepted

So you want to chroot MySQL - I'd love to say no problem, but that's not the case. It's a moody beast and it doesn't like to be jailed in chroot :P

Chroot instructions will vary between operating systems or even distributions, but here you go:

if you need more just search mysql chroot + your distro name

share|improve this answer
chroot seems to be a sysadmin command, and I don't have permissions to use it, since I could supposedly use it to gain root access; any other way? I'm trying to do this as a user with no permissions – codersarepeople Jun 27 '12 at 20:44
Use fakechroot instead. – c2h5oh Jun 27 '12 at 20:48

You should check out . I use it for running various sandbox instances on my laptop to test different versions of mysql. It seems to run OK from just my homedir, but I have not tested running a sandbox with another mysqld instance on the same box. Should probably run alright, since it allocates a non-standard port but you should be careful.

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.