LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MySQL ERROR on CentOS 7 (https://www.linuxquestions.org/questions/linux-newbie-8/mysql-error-on-centos-7-a-4175560043/)

harunaadoga 11-27-2015 04:38 PM

MySQL ERROR on CentOS 7
 
Hello,
I am trying to create databases using mysql on centOS 7, after typing the command mysql -u root, I got the following error:

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

NB: One of the solutions I found after internet searches which did not work was to create the file /var/lib/mysql/mysql.sock and change the owner to mysql user, I got the error: user mysql does not exist.

ericson007 11-27-2015 04:56 PM

Could you confirm that you installed the server package, not just the client, that the service is running using

Code:

systemctl status mariadb

And that you have it enabled to run at system startup please.

harunaadoga 11-28-2015 06:21 AM

systemctl status mariadb says mariadb is not running and systemctl start mariadb does not start it even though rpm -qa | grep mariadb shows that it is installed. Not sure why this is happening.

berndbausch 11-28-2015 06:31 AM

Quote:

Originally Posted by harunaadoga (Post 5456362)
systemctl status mariadb says mariadb is not running and systemctl start mariadb does not start it even though rpm -qa | grep mariadb shows that it is installed. Not sure why this is happening.

"doesn't start it" - what does this look like? I.e. is there an error message?

By the way, Mysql or Mariadb?

harunaadoga 11-28-2015 07:13 AM

Thanks guys I have been able to get mysql running by following the installation steps I just found here https://devops.profitbricks.com/tuto...l-on-centos-7/

Now mysql -u root takes me to the mysql configuration prompt.

ericson007 11-28-2015 08:57 AM

No worries.
Just remember if you just install mariadb that will install client side only. You need to specify mariadb-server.

Follow that for the php extensions etc you need too.

Just be aware that the official database for centos is mariadb, not mysql.

Not sure how well mysql would be integrated in terms of selinux and such.

Anyhow,

Have fun.

harunaadoga 11-28-2015 02:56 PM

Thanks ericson007.


All times are GMT -5. The time now is 12:14 PM.