Last Updated: February 25, 2016
·
1.296K
· Cedric Dugas

Monkey patch mysql recipe for using with chef solo

Running mysql recipe with chef solo on ubuntu will output a weird error that it cannot connect:

Error executing action `run` on resource 'execute[mysql-install-privileges]'
STDERR: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

You can "fix" this problem adding the line 140 in mysql recipe server.rb

139 subscribes :run, resources("template[#{grants_path}]"), :immediately
140 ignore_failure true # "Can't connect to MySQL" monkeyfix