Installed MariaDB on RHEL7 but have no access

Latest response

I am new to RHEL7 so I am playing around with it..

I installed MariaDB
sudo yum install mariadb-server

Then started it
sudo systemctl start mysqld

but if I do a mysql I can get it but don't have access to anything.. can someone help

Responses

Try running the secure_installation:
sudo mysql_secure_installation

It guides you through an interactive installation. You can pretty much answer 'yes' to everything and set a root password. Then you should be good to go. Good luck!

its asking for a password

[root@rhel73 ~]# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

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' (111)
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' (111)
Enter current password for root (enter for none):

I got it working.. I had to run the following command first

sudo systemctl start mariadb

Now how can I make it start every time my server boots

To make it automatically start at boot use:

sudo systemctl enable mariadb

thanks everyone...it worked

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.