LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Problem to mysql (https://www.linuxquestions.org/questions/linux-software-2/problem-to-mysql-4175542475/)

Huamin 05-13-2015 08:27 AM

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)

AlucardZero 05-13-2015 08:34 AM

start mysqld

Huamin 05-15-2015 03:14 AM

Sorry, I get this
[huamin@CentOS65x64 ~]$ start mysqld
start: Unknown job: mysqld
[huamin@CentOS65x64 ~]$

chrism01 05-15-2015 08:42 AM

Code:

# as root user

service mysqld start

assuming you have it installed
Code:

rpm -qa|grep -i mysql

Huamin 05-20-2015 02:34 AM

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.

Huamin 05-21-2015 06:58 AM

Any help?

TenTenths 05-21-2015 08:28 AM

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

TB0ne 05-21-2015 09:38 AM

Quote:

Originally Posted by Huamin (Post 5365490)
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.

Huamin 05-21-2015 11:11 PM

Many thanks all.


All times are GMT -5. The time now is 04:23 PM.