Geting error while connecting to remote Mysql host using Ansible.
Playbook as below
---
- name: "Create database"
login_host: host.xyz.com
login_password: "{{ mysql_root_pass }}"
login_port: "{{ mysql_port }}"
login_user: "{{ mysql_root }}"
mysql_db: "db=\"{{ item }}\" state=present"
When try to connect getting following error.
"msg": "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)\n"