MySQL – CHROOT Install After Installing MySQL 5.6

MySQLSecurity

I installed some time ago Mysql 5.6 on Ubuntu server 12.04 and now I'd like to enhance security by putting mysql into a CHROOT environment on that same Ubuntu server.

Is this possible without re-installing the whole mysql? mysql files are under var/lib and system files are under OPT/mysql/server-5.6

Anyone did this before?
Thanks

Best Answer

I didn't tested it but mysql has build in support for chroot by adding "chroot=/path/to/chroot" into my.cnf

Normally mysql should start and load all libraries and the log files it needs and then make a chroot to the path set in the parameter. That means the database must be in the chroot and the path in the config file have to be relative to the chroot.

So if your "datadir" path is set to /var/lib/mysql/data and your chroot is /var/lib/mysql you have to change the "datadir" path to /data

According to the documentation LOAD DATA INFILE and SELECT ... INTO OUTFILE having some limits.

http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_chroot