>>> #2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).
>>
>> You need to have the following *ALL* agree on where mysql.sock is
>> supposed to be. Also, be sure that the MySQL server is running.
>> Chances are, it's best to put the socket where the standard
>> installation on your platform wants it, as most packages on your
>> platform will expect to find it there.
>>
>> There are several "standard" places to put mysql.sock (this list
>> is almost certainly not complete):
>> /tmp/mysql.sock
>> /var/lib/mysql/mysql.sock (RedHat)
>> /private/tmp/mysql.sock (MacOS)
>> /var/run/mysqld/mysqld.sock
>> /var/tmp/mysql.sock
>>
>
> Which one is right for HIS situation? And is this the problem?
The error message is pretty obvious. The MySQL client in PHP
can't find the server socket. If you Google the error message,
this becomes even more obvious. If the server is running, the
problem is that client and server don't agree on the location of
the socket.
Everyone has to agree where the MySQL server socket is. If they
do, things will work. If they don't, things will break. If
phpMyAdmin and the MySQL package disagree over where the socket
should be, well, just pick a location. I'd prefer to stick with
the location the MySQL packages use, as that's most likely what any
more packages you install that use MySQLwill be set up for, but if
there is no consensus between multiple MySQL packages, and sometimes
it seems that every single package uses a different place, just pick
one. Then change all the others to use that one. I'd prefer to
use the location where MySQL puts the socket now.
>> (1) Where the MySQL server thinks the mysql.sock socket is supposed
>> to be. (If the server is not running, start it). You can
>> change this with a line like (add this if it's not there):
>> socket=/var/mysql/mysql.sock
>> in the [server] or [mysqld] sections of the my.cnf file
>> (typically /etc/my.cnf , /etc/mysql/my.cnf , /usr/local/etc/my.cnf
>> , /usr/local/etc/mysql/my.cnf, or ~/.my.cnf ). You need to
>> restart the mysqld server process to make the change take
>> effect.
>>
>> The command line utility (from a shell) can tell you where the
>> server thinks the socket should be:
>> mysql -e "show variables like 'socket'"
>> (Note difference between single and double quotes). You may
>> need to add options for a user name and/or password. If 'mysql'
>> complains that it can't find the socket, either the server is
>> not running, or (1) and (2) disagree - fix that first.
>>
>
> His distro should take care of this situation automatically.
He said he installed MySQL separately. It would appear that his
MySQL package (probably also included Apache and PHP) and his
phpMyAdmin package disagree on where the socket is supposed to be.
It's not at all surprising that there might be several distributions
of MySQL *for the same distro* that disagree about where the server
socket is supposed to be.
He needs to know where the server wants to put the socket.
>> (2) Where the MySQL command-line client 'mysql' and other client
>> software thinks the mysql.sock socket is supposed to be. You
>> can change this in the [client] or [mysql] section of the
>> my.ini (or a .my.ini file in your home directory). Add or
>> edit the line:
>> socket=/var/mysql/mysql.sock
>> If you start up the 'mysql' command-line client and it's looking
>> for the socket in the wrong place, the error message will tell
>> you where it's looking for the socket and didn't find it.
>>
>> Beware that if you mix-n-match versions of the MySQL client
>> library, they might end up with different defaults for the
>> different programs using them. Generally, pick one version
>> and stick to it, then upgrade all of them at once.
>>
>
> Which is different from where PHP thinks it should be.
The example of /var/mysql/mysql.sock I'm using is from the
instructions he followed in installing phpMyAdmin. That particular
filename is the only example I have of where the socket might be.
There's a difference between two identical copies of the MySQL client
library in different places and two different versions of it.
>> (3) Where PHP thinks the mysql.sock socket is supposed to be (for
>> each of 3 interfaces: mysqli, mysql, and pdo_mysql. If you
>> do not have all of these installed, no problem, you only need
>> the ones your code uses or the ones used by packages. Don't
>> write new code for the 'mysql' interface - it's obsolete.)
>> These values are used if a socket is not specified when you
>> (or the package) open the socket, and default to the value
>> used by the MySQL client library, so you ordinarily don't have
>> to worry about this. You can change this by changing (or
>> adding) the lines in the php.ini file:
>> mysqli.default_socket=/var/mysql/mysql.sock
>> mysql.default_socket=/var/mysql/mysql.sock
>> pdo_mysql.default_socket=/var/mysql/mysql.sock
>> You need to restart Apache to make the change take effect.
>>
>
> Which again should be taken care of by his distro.
His system distro did not include MySQL, as he installed it separately.
>
>> (4) Where phpMyAdmin thinks the mysql.sock socket is supposed to
>> be, if it passes one when it opens a database connection.
>> Since phpMyAdmin deals with multiple servers, this information
>> is handled on a per-server basis. See the phpMyAdmin documentation
>> for how to change server setup.
>>
>
> He installed it according to the PHPMyAdmin documentation.
The phpMyAdmin documentation doesn't know which MySQL package he
installed. There are lots of them. It wouldn't surprise me at all
if they disagree over where the socket is supposed to be. Otherwise,
it would just work. Do you think the OP is lying about a problem
that doesn't really exist?
>> (5) Where any other PHP applications think the mysql.sock socket
>> is supposed to be (if they use MySQL at all). If you have any
>> of these, refer to their documentation. You probably don't
>> have to change these unless you CHANGE (1) or (2) above.
>>
>
> Which has nothing to do with PHPMyAdmin.
If he changes the server to match phpMyAdmin, he needs to fix these
applications also, or he'll break them. I recommend sticking with
what the server is using now, but the important part is that all
programs must agree.
>> (6) Where any other non-PHP MySQL clients think the mysql.sock
>> socket is supposed to be. If you have any of these, refer to
>> their documentation. You probably don't have to change thse
>> unless you CHANGE (1) or (2) above.
>>
>
> Which has nothing to do with PHPMyAdmin.
If he changes the server to match phpMyAdmin, he needs to fix these
applications also, or he'll break them. I recommend sticking with
what the server is using now, but the important part is that all programs
must agree.
>> The 'locate' command is your friend, but be aware that the data is
>> typically updated weekly (overnight) and if you just set up your
>> system or just installed MySQL and PHP, the indexing process may
>> not have run recently enough to find the files you need to find.
>> Also, it typically does not index directories like /tmp, /usr/tmp,
>> and /var/tmp.
>>
>
> Which doesn't help him at all.
It's useful for finding the my.cnf or php.ini file which would
be edited to change settings.
>>> Here are the steps I have taken:
>>> downloaded the php 5.5 version
>>> renamed it to phpmyadmin as required and stored in /users/username/Sites
>>>
>>> (mysql has been previously set)
>>>
>>> Performed these commands in Terminal:
>>> sudo mkdir /var/mysql
>>
>> Careful: Directory /var/mysql needs to be writable by (probably
>> owned by) user 'mysql' so it can create mysql.sock in it.
>>
>
> Which is different than the PHPMyAdmin documentation.
I didn't make up that path: that's what the OP posted, and
I thought it was because he was following the phpMyAdmin
documentation.
>>> sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
>>>
>>> Created config folder in phpmyadmin
>>> mkdir ~/Sites/phpmyadmin/config
>>>
>>> chmod o+w ~/Sites/phpmyadmin/config
>>>
>>> Performed all required actions at
>>>
http://localhost/~username/phpmyadmin/setup/
>>> - new server
>>
>> Are you at any point here asked for a socket path?
>> How did you answer?
>>
>
> This should have been taken care of by his distro.
He installed MySQL separately. And phpMyAdmin may not be able to
guess which MySQL package he installed.
>
>>> - set mysql root user and password (the one I used for mysql)
>>>
>>> Saved
>>> Moved config.inc.php to phpmyadmin directory
>>> Deleted config directory
>>>
>>> Tried to go to
>>>
http://localhost/~username/phpmyadmin/
>>> and when typed in my log in name and password got the above error
>>
>> Note: there's an alternative way to get this to work. Use the
>> server name 'Localhost' ( or 'LoCaLhOsT', but not 'localhost' - any
>> name that downcases to 'localhost' but is not the exact string
>> 'localhost' will be treated as a TCP/IP host), and mysql will use
>> TCP/IP rather than a UNIX-domain socket. I did actually find this
>> obscure tidbit of information in the MySQL documentation somewhere,
>> once. UNIX-domain sockets are supposedly a bit faster.
>>
>
> Which still has nothing to do with PHPMyAdmin.
>
> IOW, a lot of things to screw up his implementation, but nothing that
> really helps him. If he has a problem with installing according to the
> PHPMyAdmin documentation, his best bet is to get help from the people
> who WROTE that documentation and find his problem - rather than screw up
> his installation completely by trying random "fixes".
The phpMyAdmin people probably don't know where the socket is on
all of the various MySQL packages out there.
The people in charge of the MySQL package he installed probably do
know where they put the socket.