I used the following lines in my cookbook
mysql_service 'default' do
bind_address '0.0.0.0'
initial_root_password 'password'
action [:create, :start]
end
And here is the my.cnf
# Chef generated my.cnf for instance mysql-default
[client]
default-character-set = utf8
port = 3306
socket = /run/mysql-default/mysqld.sock
[mysql]
default-character-set = utf8
[mysqld]
user = mysql
pid-file = /run/mysql-default/mysqld.pid
socket = /run/mysql-default/mysqld.sock
bind-address = 0.0.0.0
port = 3306
datadir = /var/lib/mysql-default
tmpdir = /tmp
log-error = /var/log/mysql-default/error.log
!includedir /etc/mysql-default/conf.d
[mysqld_safe]
socket = /run/mysql-default/mysqld.sock
But I am unable to login:
mysql -u mysql -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
I have also tried login 'root' and it did not work either.
What did I miss in my cookbook?
Cheers, Tony