mysql "can't create test file" error on Centos
If your chmod and chown settings are already correct you might need to look into selinux.
This page explains how to configure selinux for mysql:
https://blogs.oracle.com/jsmyth/entry/selinux_and_mysql