Connect with Expertise | Find Experts, Get Answers, Share Insights

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

jiing
 
Posts: n/a
#1: Jul 23 '05
Now let me describe what I have done and my purpose:

Originally, I want to user ports to install phpBB
But I found that phpBB doesn't support mysql 5.x (but the ports
installed mySQL 5.0.0 alpha)
so I deinstall mysql5-server and mysql5-client
And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by
ports
but now , mysql is not workable

freebsd# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
freebsd# su
freebsd# su jiing
freebsd [/]-jiing->mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)
all of them have problems

I also try to execute
freebsd# /usr/local/libexec/mysqld
050308 11:42:29 [ERROR] Can't start server: Bind on TCP/IP port:
Address already in use
050308 11:42:29 [ERROR] Do you already have another mysqld server
running on port: 3306 ?
050308 11:42:29 [ERROR] Aborting
050308 11:42:29 [NOTE] /usr/local/libexec/mysqld: Shutdown complete

It say that I have another one mysql deamon and also using port 3306
So I use

mysqladmin -u root shutdown

try to shutdown mysql
The result is
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket
'/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock'
exists!

I also execute

freebsd# killall mysqld

to kill all mysqld

freebsd# ps xa | grep mysqld

Then execute mysqld again

freebsd [/]-jiing->/usr/local/libexec/mysqld
050308 12:58:52 [WARNING] Can't create test file
/var/db/mysql/freebsd.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/'
(Errcode: 13)
050308 12:58:52 [ERROR] Aborting
050308 12:58:52 [NOTE] /usr/local/libexec/mysqld: Shutdown complete

I havd read http://groups.google.com.tw/groups?h...m%3Dmailing.da
abase.mysql.38D65AC0.400980FF%2540americasm01.nt.c om%26rnum%3D7

But still not very sure of what they say
I edit a my.cnf
freebsd# ee /etc/my.cnf

the content of my.cnf is
[mysqld]
socket =/tmp/mysql.sock

[client]
socket=/tmp/mysql.sock
user=root
host=localhost
password=feng
================================================== ============
But when I execute /usr/local/libexec/mysqld

freebsd [/usr/local/bin]-jiing->/usr/local/libexec/mysqld
050308 14:04:25 [WARNING] Can't create test file
/var/db/mysql/freebsd.lower-test
/usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/'
(Errcode: 13)
050308 14:04:25 [ERROR] Aborting

050308 14:04:25 [NOTE] /usr/local/libexec/mysqld: Shutdown complete
================================================== ===========
still can't work.

How can I do to solve this problem, thanks.

-jiing-

Jonathan
 
Posts: n/a
#2: Jul 23 '05

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


jiing wrote:[color=blue]
> Now let me describe what I have done and my purpose:
>
> Originally, I want to user ports to install phpBB
> But I found that phpBB doesn't support mysql 5.x (but the ports
> installed mySQL 5.0.0 alpha)
> so I deinstall mysql5-server and mysql5-client
> And then I install mysql41-server and mysql41-client on FreeBSD 5.3 by
> ports
> but now , mysql is not workable
>
> freebsd# mysql
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2)
> freebsd# su
> freebsd# su jiing
> freebsd [/]-jiing->mysql
> ERROR 2002 (HY000): Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2)
> all of them have problems
>
> I also try to execute
> freebsd# /usr/local/libexec/mysqld
> 050308 11:42:29 [ERROR] Can't start server: Bind on TCP/IP port:
> Address already in use
> 050308 11:42:29 [ERROR] Do you already have another mysqld server
> running on port: 3306 ?
> 050308 11:42:29 [ERROR] Aborting
> 050308 11:42:29 [NOTE] /usr/local/libexec/mysqld: Shutdown complete
>
> It say that I have another one mysql deamon and also using port 3306
> So I use
>
> mysqladmin -u root shutdown
>
> try to shutdown mysql
> The result is
> mysqladmin: connect to server at 'localhost' failed
> error: 'Can't connect to local MySQL server through socket
> '/tmp/mysql.sock' (2)'
> Check that mysqld is running and that the socket: '/tmp/mysql.sock'
> exists!
>
> I also execute
>
> freebsd# killall mysqld
>
> to kill all mysqld
>
> freebsd# ps xa | grep mysqld
>
> Then execute mysqld again
>
> freebsd [/]-jiing->/usr/local/libexec/mysqld
> 050308 12:58:52 [WARNING] Can't create test file
> /var/db/mysql/freebsd.lower-test
> /usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/'
> (Errcode: 13)
> 050308 12:58:52 [ERROR] Aborting
> 050308 12:58:52 [NOTE] /usr/local/libexec/mysqld: Shutdown complete
>
> I havd read http://groups.google.com.tw/groups?h...m%3Dmailing.da
> abase.mysql.38D65AC0.400980FF%2540americasm01.nt.c om%26rnum%3D7
>
> But still not very sure of what they say
> I edit a my.cnf
> freebsd# ee /etc/my.cnf
>
> the content of my.cnf is
> [mysqld]
> socket =/tmp/mysql.sock
>
> [client]
> socket=/tmp/mysql.sock
> user=root
> host=localhost
> password=feng[/color]

Be aware the next time to never post you passwords in newsgroups!
[color=blue]
> ================================================== ============
> But when I execute /usr/local/libexec/mysqld
>
> freebsd [/usr/local/bin]-jiing->/usr/local/libexec/mysqld
> 050308 14:04:25 [WARNING] Can't create test file
> /var/db/mysql/freebsd.lower-test
> /usr/local/libexec/mysqld: Can't change dir to '/var/db/mysql/'
> (Errcode: 13)
> 050308 14:04:25 [ERROR] Aborting
>
> 050308 14:04:25 [NOTE] /usr/local/libexec/mysqld: Shutdown complete
> ================================================== ===========
> still can't work.
>
> How can I do to solve this problem, thanks.
>
> -jiing-[/color]
Closed Thread

Tags
error 2002 [hy000]