I'm aware this is a common issue, but none of the other posts helped me solve our issue (1, 2, 3, 4, 5, 6 ). I installed mariadb using an ansible as part of an openstack installation, and it crashed with the following error:
Ansible task:
name: DB - setting /root/.my.cnf become: true copy: dest: /root/.my.cnf content: | [client] user=root password="{{ DB_root_password }}" socket = /var/run/mysqld/mysqld.sock tags: db_config - name: DB - Configure MariaDB become: true template: src: openstack.cnf dest: /etc/mysql/mariadb.conf.d/openstack.cnf tags: db_config - name: DB - configure keystone access 1/3 become: true template: src: keystone.sql.j2 dest: /root/keystone.sql tags: db_config - name: DB - grant access to Keystone 2/3 become: true shell: mysql -u root < /root/keystone.sql tags: db_config
Error:
"stderr": "ERROR 2002 (HY000): Can't connect to local server through socket '/var/run mysqld/mysqld.sock' (2)"
- More info:
~# service mariadb status Process: 1039769 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 1039771 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS) Process: 1039852 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=killed, signal=ILL) Main PID: 1039852 (code=killed, signal=ILL) Mem peak: 5.4M CPU: 606ms Nov 05 14:41:26 controller01 systemd[1]: Failed to start mariadb.service - MariaDB 10.11.3 database server.
- I also get the same error (
ERROR 2002 (HY000)
) when I run the commandsmysql
ormariadb
. - I tried manually installing mariadb but the output is the same.
- I tried
mariadb_safe
but the socket is not created
/var/log/mysql/
nor/var/log/mariadb/
directories, andjournalctl
returns the same log assystemctl
orservice
do (which I already posted above). Do you have any other advice? Thanks!