Skip to content

Instantly share code, notes, and snippets.

@corny
Created September 24, 2016 00:11
Show Gist options
  • Save corny/dcf031a8af64c398efdaf0510e0c7566 to your computer and use it in GitHub Desktop.
Save corny/dcf031a8af64c398efdaf0510e0c7566 to your computer and use it in GitHub Desktop.
Ansible task to fix `Plugin 'unix_socket' is not loaded` on MariaDB
---
- name: Enable plugin unix_socket
command: mysql --defaults-file=/etc/mysql/debian.cnf -e "INSTALL PLUGIN unix_socket SONAME 'auth_socket'"
register: mysql_result
changed_when: mysql_result.rc == 0
failed_when: mysql_result.rc != 0 and 'already installed' not in mysql_result.stderr
@PapyDanone
Copy link

Thanks @corny

This is what worked for me:

---
- name: Load auth_socket plugin
  ini_file:
    path: /etc/mysql/mariadb.cnf
    section: mysqld
    option: plugin-load-add
    value: auth_socketo.so
  register: auth_socket_loaded

- service: name=mysql state=restarted enabled=yes
  when: auth_socket_loaded.changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment