LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2015, 04:38 PM   #1
harunaadoga
LQ Newbie
 
Registered: Sep 2014
Location: Hatfield, United Kingdom
Distribution: Centos
Posts: 24

Rep: Reputation: Disabled
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.
 
Old 11-27-2015, 04:56 PM   #2
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
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.
 
1 members found this post helpful.
Old 11-28-2015, 06:21 AM   #3
harunaadoga
LQ Newbie
 
Registered: Sep 2014
Location: Hatfield, United Kingdom
Distribution: Centos
Posts: 24

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-28-2015, 06:31 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by harunaadoga View Post
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?
 
Old 11-28-2015, 07:13 AM   #5
harunaadoga
LQ Newbie
 
Registered: Sep 2014
Location: Hatfield, United Kingdom
Distribution: Centos
Posts: 24

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-28-2015, 08:57 AM   #6
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
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.

Last edited by ericson007; 11-28-2015 at 09:07 AM.
 
1 members found this post helpful.
Old 11-28-2015, 02:56 PM   #7
harunaadoga
LQ Newbie
 
Registered: Sep 2014
Location: Hatfield, United Kingdom
Distribution: Centos
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thanks ericson007.
 
  


Reply

Tags
mysql centos



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Error while configuration of mysql replication in centos jayakumar01 Linux - Server 3 04-07-2012 02:39 AM
mysql error while installation of pommo software in centos 5.4 version jayakumar01 Linux - Server 2 01-24-2012 01:18 AM
Mysql startup error on Centos 5.2 custangro Linux - Server 4 09-16-2009 05:23 PM
error in installing mysql i.e. mysql-5.1.34-linux-powerpc-glibc23 in centos 4.4 i686 pankajd Linux - Newbie 1 06-07-2009 02:00 PM
Install MySQL on CentOS 3.4 gives error Azzath Linux - Server 2 05-24-2007 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration