I started secure install of MySQL with sudo mysql_secure_installation command, and I got that message:

Securing the MySQL server deployment.

Enter password for user root: 
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Thanks for answers

1 Answer 1


Despite the name, mysql_secure_installation is not for installing MariaDB; it used to secure an existing installation of MariaDB.

You should use some other method to install MariaDB (e.g. using your favourite package manager), then run mysql_secure_installation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.