LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-13-2015, 09:27 AM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Problem to mysql


Hi,
How to resolve this?

[huamin@CentOS65x64 ~]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
 
Old 05-13-2015, 09:34 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
start mysqld
 
Old 05-15-2015, 04:14 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Sorry, I get this
[huamin@CentOS65x64 ~]$ start mysqld
start: Unknown job: mysqld
[huamin@CentOS65x64 ~]$
 
Old 05-15-2015, 09:42 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,699

Rep: Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494
Code:
# as root user

service mysqld start
assuming you have it installed
Code:
rpm -qa|grep -i mysql
 
1 members found this post helpful.
Old 05-20-2015, 03:34 AM   #5
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Any advice to this problem?

[huamin@CentOS65x64 ~]$ su -
Password:
[root@CentOS65x64 ~]# mysql -h localhost -P 3306
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@CentOS65x64 ~]#

As I now still encounter the above problem.

Last edited by Huamin; 05-20-2015 at 03:41 AM.
 
Old 05-21-2015, 07:58 AM   #6
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Any help?
 
Old 05-21-2015, 09:28 AM   #7
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 2,998

Rep: Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246Reputation: 1246
If you're using the -h host -P port method then specify the non-localhost IP address of the server. For example: -h 192.168.1.2 -P 3306

When using localhost mysql will generally try to connect via socket rather than tcp/ip
 
Old 05-21-2015, 10:38 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,236

Rep: Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973Reputation: 5973
Quote:
Originally Posted by Huamin View Post
Any help?
Read the LQ Rules, along with the "How to ask a smart question" link in my posting signature.

Bumping your own thread is fairly rude..doing it without providing ANY other information about your problem is pointless. You are NOT going to get help any faster by saying "Any help?". And you've already asked this in ANOTHER thread about MySQL:
http://www.linuxquestions.org/questi...ql-4175542971/

...where you said it was 'solved', and that you WERE able to get into the mysql console. So, which is it? Try reading the MySQL documentation first...the 'problems' you're having can be solved by following the documentation about how to start the service, and how to access it. If you run 'sudo -s', then type in "mysql", that should be all you need to do for a default installation.
 
Old 05-22-2015, 12:11 AM   #9
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Many thanks all.

Last edited by Huamin; 05-22-2015 at 02:05 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
postfix +Cyrus SASL authentication problem + pam-mysql+mysql database kibirango Slackware 1 12-25-2012 09:47 AM
[SOLVED] yum install php-mysql create problem to my running mysql database jsaravana87 Linux - Server 1 08-11-2011 04:24 AM
Problem changing mysql uid,gid: mysql start fails gjatute Linux - Newbie 7 02-25-2010 02:38 AM
Problem Starting MySQL on Fresh Fedora 8 Install w/ Yum'd MySQL blong4life Linux - Server 2 07-04-2008 08:44 PM
php-mysql dependancy problem after nitemare mysql upgrade. RHEL4 andrewc Red Hat 1 01-03-2006 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:05 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration