You are not logged in.

#1 2008-02-01 15:52:16

k3rn31
Member
Registered: 2008-01-09
Posts: 145

MySQL Error - Can't fix it.

I have this error when I try to login as root (I have just installed MySQL with pacman):

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

I searched @ google and I found thousands of posts with this problem. I followed 2 ways to solve it but I can't.

If anyone can help...!

Thanks


~k3rn31

Offline

#2 2008-02-01 19:01:01

xploded101
Member
From: UK
Registered: 2007-03-29
Posts: 11
Website

Re: MySQL Error - Can't fix it.

is mysql running?

/etc/rc.d/mysqld start

Offline

#3 2008-02-01 19:08:24

k3rn31
Member
Registered: 2008-01-09
Posts: 145

Re: MySQL Error - Can't fix it.

Yeap.

/etc/rc.d/mysqld start
:: Starting MySQL                                                        [DONE]

I re-type the command to login: (mysql -u root -p)

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

~k3rn31

Offline

#4 2008-02-01 21:55:12

xploded101
Member
From: UK
Registered: 2007-03-29
Posts: 11
Website

Re: MySQL Error - Can't fix it.

try netstat -v | grep mysql

and check the path to mysql.sock

Offline

#5 2008-02-01 22:14:51

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: MySQL Error - Can't fix it.

grep socket /etc/my.cnf

make sure the path's that are output match.
one is for the client, the other is for the server.


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#6 2008-02-01 22:22:13

May-C
Member
Registered: 2007-12-28
Posts: 83

Re: MySQL Error - Can't fix it.

Just did install mysql today myself... Read carefull the output after pacman -S mysql, this should help !
I guess you can't login as root as there is not such account yet.

Once you've started the MySQL server, you probably want to add a root account in order to maintain your MySQL users and databases. This can be done manually or automatically, as mentioned by the output of the above script. Either run the commands to set a password for the root account, or run the secure installation script.

Last edited by May-C (2008-02-01 22:26:03)

Offline

#7 2008-02-02 09:15:04

k3rn31
Member
Registered: 2008-01-09
Posts: 145

Re: MySQL Error - Can't fix it.

cactus wrote:
grep socket /etc/my.cnf

make sure the path's that are output match.
one is for the client, the other is for the server.

Hi thanx for your reply. I typed this and this I got:

grep socket /etc/my.cnf
socket        = /var/lib/mysql/mysql.sock
socket        = /var/lib/mysql/mysql.sock
# All interaction with mysqld must be made via Unix sockets or named pipes.

@ May-C:

Ok. But what to do to check the root user status?

Thanks for all


~k3rn31

Offline

#8 2008-02-02 12:14:01

May-C
Member
Registered: 2007-12-28
Posts: 83

Re: MySQL Error - Can't fix it.

run in a console follwing:

mysql_secure_installation

Offline

#9 2008-02-02 18:27:38

k3rn31
Member
Registered: 2008-01-09
Posts: 145

Re: MySQL Error - Can't fix it.

Enter current password for root (enter for none): 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I don't think that  I have already set a root password. What I must do now? I tried null pass and I hit enter but I got the ^^ error.
I tried to reinstall it but I didn't think that succeded.

Any ideas?

Thanks

Last edited by k3rn31 (2008-02-02 18:49:34)


~k3rn31

Offline

#10 2008-02-03 09:05:17

k3rn31
Member
Registered: 2008-01-09
Posts: 145

Re: MySQL Error - Can't fix it.

Any ideas for this ^^ how to safe remove mysql and settings and to reinstall it (and to set the root password correctly)?

I got backups. I only need to remove and reinstall mysql and a php mysql interface like phpmyadmin

Thanks

Last edited by k3rn31 (2008-02-03 09:06:17)


~k3rn31

Offline

#11 2008-02-03 10:58:39

May-C
Member
Registered: 2007-12-28
Posts: 83

Re: MySQL Error - Can't fix it.

Enter current password for root (enter for none):
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

After restart you have to do again as root:

/etc/rc.d/mysqld start

and then:

mysql_secure_installation

There is no need for reinstall the whole thing!

If you want to start mysql by every boot make sure you add mysqld too the deamons array in rc.conf!

Last edited by May-C (2008-02-03 11:04:18)

Offline

#12 2008-02-03 13:47:52

k3rn31
Member
Registered: 2008-01-09
Posts: 145

Re: MySQL Error - Can't fix it.

Thanks fixed. Another one question about phpmyadmin.

I installed, configured with config.inc.php and I got this:

Error

MySQL said: Documentation
#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured) .

Any ideas?

Thanks


~k3rn31

Offline

#13 2008-02-05 15:51:13

k3rn31
Member
Registered: 2008-01-09
Posts: 145

Re: MySQL Error - Can't fix it.

Now it's doing the same thing:

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

Anyone to help?

Thank you


~k3rn31

Offline

Board footer

Powered by FluxBB