MySQL ERROR 2002 (HY000) no CentOS 5

0

Eu tenho problema com o arranque do mysql. Quando eu digito

service mysql start

Tudo que eu tenho é

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

Como posso corrigir isso?

    
por Jasmin Subasic Suba 30.07.2012 / 11:13

1 resposta

1

Primeiro, verifique o status do serviço

[root@localhost ~]# service mysqld status

mysqld is stopped

[root@localhost ~]# su - max
Password:

Se o serviço for interrompido, você receberá esse tipo de erro

 
[max@localhost ~]$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Agora inicie o serviço

[max@localhost ~]$ su -
Password: 
[root@localhost ~]# service mysqld start
Starting mysqld:                                           [  OK  ]

Agora verifique o status do serviço

[root@localhost ~]# service mysqld status
mysqld (pid  6157) is running...
[root@localhost ~]# exit
logout
[max@localhost ~]$ mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.61 Source distribution

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
    
por 25.10.2012 / 13:11