#2002 - The server is not responding (or the local MySQL server's
socket is not correctly configured)
I did notice there are two processes running. Do I kill one of them?
_mysql 599 0.0 0.6 112936 13624 ?? S 7:17PM
0:00.19 /usr/loca
l/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/
mysql/data --
user=mysql --pid-file=/usr/local/mysql/data/janis-roughs-power-mac-
g5.local.pid
root 572 0.0 0.0 75944 764 ?? S 7:17PM
0:00.03 /bin/sh .
/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/
mysql/dat
a/janis-roughs-power-mac-g5.local.pid
In my php,ini I have the default socket set :
mysql.default_socket = /tmp/mysql.sock
Let me know if this is a php error not mysql.
Please be sure to spell error messages correctly. I do not believe
you got an error message containing the phrase 'cannot mysql socket'.
>I did open some ports on my router but I can't see how
>that would affect anything especially on local hosts.
It is unclear what your setup is.
(1) What host is the MySQL server (mysqld) running on?
(2) What host is the web server for phpMyAdmin running on?
(3) What host is the web browser running on?
Are the hosts for (1) and (2) the same? If they are NOT, then
you have to set up MySQL to be accessed from a different host,
and you won't be using the local socket, and you'll have to worry
about ports on the router.
If the hosts for (1) and (2) are the same, you'll probably be using
the local socket, and ports on the router should not matter for
this problem (but you still need to let web clients through, unless
that's on the same host as (1) and (2) also.
>#2002 - The server is not responding (or the local MySQL server's
>socket is not correctly configured)
If you are running mysqld and the web server on the same host, it
is important that PHP and mysqld agree on where the socket is.
>I did notice there are two processes running. Do I kill one of them?
It is quite normal to have one mysqld_safe and one mysqld process
running.
>In my php,ini I have the default socket set :
>mysql.default_socket = /tmp/mysql.sock
Make sure you are editing the php.ini that is actually being used.
If you get desperate, edit all of them. Also be sure to restart
Apache after making changes to php.ini if PHP is being run as
an Apache module.
When the MySQL Server is running, does /tmp/mysql.sock exist?
If not, does a mysql.sock exist elsewhere? If so, maybe that
is the correct location of mysql.sock.
>Let me know if this is a php error not mysql.
PHP and MySQL must agree on where the socket is, and you cannot
blame this on only one of them.
>
> >I did open some ports on my router but I can't see how
> >that would affect anything especially on local hosts.
>
> It is unclear what your setup is.
>
> (1) What host is the MySQL server (mysqld) running on?
MySQL server is running on the local host on my Mac, internal IP
192.168.X.XX on my main hard drive. I can only use one hard drive at
a time.
The other one I use for Filemaker Server for testing on it so it
doesn't mess up my MySQL/PHP server. I just rebooted and got my main
hard drive back.
I have configured a dynamic loopback outside IP at
janisrough.dyndns.biz for web traffic but shouldn't have anything to
do with it. I'm not serving any MySQL db's. I probably confused you
with mentioning it. It is a normal testing setup.
> (2) What host is the web server for phpMyAdmin running on?
The pma is running out of my Sites folder on my main hard drive.
> (3) What host is the web browser running on?
I think the dyndns.biz loopback works on both hard drives. I put the
software on both.
> Are the hosts for (1) and (2) the same?
They are the same.
If they are NOT, then
> you have to set up MySQL to be accessed from a different host,
> and you won't be using the local socket, and you'll have to worry
> about ports on the router.
The router is the same.
> If the hosts for (1) and (2) are the same, you'll probably be using
> the local socket, and ports on the router should not matter for
> this problem (but you still need to let web clients through, unless
> that's on the same host as (1) and (2) also.
>
> >#2002 - The server is not responding (or the local MySQL server's
> >socket is not correctly configured)
>
> If you are running mysqld and the web server on the same host, it
> is important that PHP and mysqld agree on where the socket is.
>
> >I did notice there are two processes running. Do I kill one of them?
>
> It is quite normal to have one mysqld_safe and one mysqld process
> running.
>
> >In my php,ini I have the default socket set :
> >mysql.default_socket = /tmp/mysql.sock
>
> Make sure you are editing the php.ini that is actually being used.
> If you get desperate, edit all of them. Also be sure to restart
> Apache after making changes to php.ini if PHP is being run as
> an Apache module.
This is a new install, I didn't install PHP it came with the distro.
I am fairly confident I only have that one.
> When the MySQL Server is running, does /tmp/mysql.sock exist?
> If not, does a mysql.sock exist elsewhere? If so, maybe that
> is the correct location of mysql.sock.
I don't know where to look for another mysql sock. I only found one
in the /tmp directory. I did notice two installations of mysql one
is 5.0.82
presumably I installed the latest. There is a link from the mysql
directory to the mysql 5.0.82 directory.
There is a logfile in the mysql directory ib_logfiel0 and iblogfile1
but I couldn't read it with vi.
thanks,
OK, so apache and PHP work, and you think mysqld is running, but cant
see it.
what happens if you run 'mysql' from a console?
this is what I get after pma set up. The db and login I'm trying to
access and the mysql socket error.
-----------
Runtime Notice in ./libraries/common.inc.php#279
date_default_timezone_get() [function.date-default-timezone-get]: It
is not safe to rely on the system's timezone settings. Please use the
date.timezone setting, the TZ environment variable or the
date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected 'America/Los_Angeles'
for 'PST/-8.0/no DST' instead
Backtrace
./libraries/common.inc.php#279: date_default_timezone_get()
./setup/lib/common.inc.php#18: require_once(./libraries/
common.inc.php)
./setup/index.php#12: require(./setup/lib/common.inc.php)
Warning in ./libraries/dbi/mysqli.dbi.lib.php#85
mysqli_real_connect() [function.mysqli-real-connect]: (HY000/2002):
Can't connect to local MySQL server through socket '/var/mysql/
mysql.sock' (2)
Backtrace
./libraries/dbi/mysqli.dbi.lib.php#85: mysqli_real_connect(
NULL,
string localhost,
string dhandler_rockridge,
string Time2e@t
string ,
integer 0,
string ,
integer 0,
)
./libraries/common.inc.php#901: PMA_DBI_connect(
string dhandler_realrockridge,
string T!me2e@t!,
boolean ,
)
./index.php#34: require_once(./libraries/common.inc.php)
It's giving you a *VERY LARGE* hint here. Is that /tmp/mysql.sock?
I don't think so.
Note that there's several pieces that all need to agree on the socket,
and all should agree.
- The mysqld server.
- The command-line MySQL clients, like 'mysql' and 'mysqldump'.
- PHP's mysql client.
- Any other mysql clients you've got, like one associated with
Perl, or Ruby, or Python, or ...
The first two will probably agree, so it's more likely you want to
change PHP's idea of it.
If you have two installations of MySQL, with different default sockets,
you may have two installations of the MySQL client programs with the
same issue. Figure out which set to use, if you need these.
That's likely caused by PHP 5.3.0 which likes you to have set the timezone
before using a date() or time() functions.
I cannot find this second var/mysql.sock. I looked around for it. I
did look in the old mysql directory. I noticecd there is a data
directory that is the same as the second updated mysql directory with
the same databases. It has the same databases in it. Can I just
delete it? Or is that because there is a symbolic link to it? It is
possible I just moved the databases over to the second directory. I
opened MySQL Administrator and it is referring to the /tmp/mysql.sock.
If I delete all the old mysql files will that remove the var/
mysql.sock. There is a var directory but it doesn't have mysql.sock
in it. There may be another var directory some place but I can't find
it.
Read the path name above, very carefully.
>>
>> It's giving you a *VERY LARGE* hint here. �Is that /tmp/mysql.sock?
>> I don't think so.
>>
>> Note that there's several pieces that all need to agree on the socket,
>> and all should agree.
>> � � � � - The mysqld server.
>> � � � � - The command-line MySQL clients, like 'mysql' and 'mysqldump'.
>> � � � � - PHP's mysql client.
>> � � � � - Any other mysql clients you've got, like one associated with
>> � � � � � Perl, or Ruby, or Python, or ...
>>
>> The first two will probably agree, so it's more likely you want to
>> change PHP's idea of it. �
>>
>> If you have two installations of MySQL, with different default sockets,
>> you may have two installations of the MySQL client programs with the
>> same issue. �Figure out which set to use, if you need these.
>
>I cannot find this second var/mysql.sock. I looked around for it. I
Read that path name again, carefully.
You might consider using 'find' to find any file on the hard drive
named 'mysql.sock'. It's possible that the socket got deleted, in
which case consider restarting the server before trying this. This
may take a considerable amount of time.
>did look in the old mysql directory. I noticecd there is a data
>directory that is the same as the second updated mysql directory with
>the same databases. It has the same databases in it. Can I just
>delete it?
Careful. One way of moving directories around without reconfiguring the
software is to move the data, then plant a symlink at the original
location. You might be about to delete your *only* copy. Make really
sure these are different copies before deleting one. One method of
checking this is observing that the files in one copy have really old
modification dates and the files in the other copy have more recent
modification dates.
>Or is that because there is a symbolic link to it? It is
>possible I just moved the databases over to the second directory. I
>opened MySQL Administrator and it is referring to the /tmp/mysql.sock.
What was it that referred to /var/mysql/mysql.sock again?
It is possible that individual PHP applications have their own
configuration for where to find the MySQL server, and you need to
fix these to use the correct socket also.
>If I delete all the old mysql files will that remove the var/
>mysql.sock.
I thought you said this didn't exist?
>There is a var directory but it doesn't have mysql.sock
>in it. There may be another var directory some place but I can't find
>it.
Suggestions:
1. Restart the server (e.g. reboot if you have multiple installations
and are unsure which one you are restarting).
2. Figure out where mysql.sock is. Use 'find' to search the whole system.
This might be very time-consuming. The socket you have should have
a recent modification time, around that of the reboot.
3. Now that you've figured out where the socket really is, set all
the clients to use that socket. This might include PHP applications
as well as PHP itself.
4. If you find a client complaining about not being able to open a different
socket than the correct one, go back to 3 and fix it.