LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 08: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, 08: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, 03: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, 08:42 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,235

Rep: Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709Reputation: 2709
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, 02: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 02:41 AM.
 
Old 05-21-2015, 06:58 AM   #6
Huamin
Member
 
Registered: May 2011
Posts: 562

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

Rep: Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540Reputation: 1540
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, 09:38 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 25,802

Rep: Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745Reputation: 7745
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-21-2015, 11:11 PM   #9
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Many thanks all.

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

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

All times are GMT -5. The time now is 12:51 AM.

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