How to chroot MySQL for users


2017-03-27 05:30:08 UTC


2017-08-08 13:14:20 UTC


Was this article helpful?

Have more questions?

Submit a request

How to chroot MySQL for users

Applicable to:

  • Plesk 12.5 for Linux


How to make MySQL available for chrooted Plesk users?


First of all, it is not recommended to give the access to MySQL in chrooted environment as it is designed to isolate a user from any system services.

  1. Follow the instructions from article #213909545
  2. Create the following folder for required domain:
    # mkdir -p /var/www/vhosts/
  3. Bind MySQL socket to the folder:
    # mount --bind /var/run/mysqld /var/www/vhosts/
Have more questions? Submit a request


  • 0
    Rico Rothenburger

    That's not a good idea. Logged-in users can delete the file, which terminates the entire MySQL server.

    better: mount -o bind,ro /var/run/mysqld /var/www/vhosts/

    In general, however, the mount causes Plesk to delete the file and the MySQL server is no longer working. For example, if you delete the client, then all files will be deleted and also the mysqld.sock file.

    Is this workaround only for Plesk 12.5?

    Edited by Rico Rothenburger
  • 0
    Bulat Tsydenov

    @Rico This workaround is applicable for all currently supported Plesk versions for Linux

Please sign in to leave a comment.