When using a data_dir value different from the default one, mysql cookbook fails to work properly. The issue is because the root password is set before the config file is created, and appears when trying to perform more mysql actions during the same chef run.
This issue was found on a CentOS system but I assume its the same bug elsewhere.
How to reproduce:
1) Include recipe mysql in the run list.
2) Set the data_dir attribute with something other then the default value.
3) Set the root_password attribute for usage in the next step.
4) Have another recipe that say creates a new database on this server using the database_mysql lwrp (provided by the database cookbook).