mariadb v15.1 do not installs socket / Centos 7

Zaza asked:

Installed CentOS 7 fresh

# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

yum -y install mariadb-server mariadb

# mysql -V
mysql  Ver 15.1 Distrib 5.5.52-MariaDB, for Linux (x86_64) using readline 5.1

/usr/bin/mysql_secure_installation


Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Enter current password for root (enter for none):

 mysqladmin password newpassword

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

checking /var/lib/mysql/

la /var/lib/mysql/

# ls /var/lib/mysql/
aria_log.00000001  aria_log_control  ibdata1  ib_logfile0  ib_logfile1  mysql  performance_schema  test

any idea why that should happening ?
and how to fix

My answer:


The error you got was:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

2 is ENOENT, or No such file or directory. This means the socket doesn’t exist. And the cause of that is that MariaDB is not running. You need to start MariaDB before running mysql_secure_installation.

systemctl start mariadb

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.