Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Accepted Answer
Just removed mariadb and reinstalled it and did I think I did something wrong at the setup phase after the mysql_secure_installation part, this time I set a pw for root and I can now login.
A temporary, random root password is generated and stored in the error log, which is /var/log/mysqld.log for an installation by the MySQL Yum repository. You can use this command to see the password:
shell > sudo grep ‘temporary password’ /var/log/mysqld.log
Source: https://www.digitalocean.com/community/questions/mysql-5-7-7-centos-7-el7-access-denied
I’ve got the same issue: right after the 'yum install mariadb-server' the script mysql_secure_installation won’t accept blank root password, saying:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
I’ve found that it’s because directory /var/lib/mysql is not empty and there were wrong privilegies on the /var/lib/mysql
mariadb honestly tells about it in journalctl -xe:
-- Unit mariadb.service has begun starting up.
Nov 06 15:14:15 openproject.exprem.dom mariadb-prepare-db-dir[15228]: Database MariaDB is not initialized, but the directory /var/lib/mysql is not empty, so initializat
Nov 06 15:14:15 openproject.exprem.dom mariadb-prepare-db-dir[15228]: Make sure the /var/lib/mysql is empty before running mariadb-prepare-db-dir.
Nov 06 15:14:15 openproject.exprem.dom systemd[1]: mariadb.service: control process exited, code=exited status=1
Nov 06 15:14:15 openproject.exprem.dom systemd[1]: Failed to start MariaDB database server.
the solution is:
# chown -R mysql:mysql /usr/local/var/mysql
# rm -rf /var/lib/mysql/*
# systemctl start mariadb.service
and after that mysql_secure_installation script ran correctly