Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

phpmyadmin #2002 - No such file or directory

3,994 views
Skip to first unread message

Alla

unread,
Jul 11, 2016, 7:16:30 AM7/11/16
to
Hello!
My system Mac os x 10.7

I am new to php (and programming, currently learning basics of C). I have trouble setting up
phpmyadmin. I have followed all necessary steps, including the last one of moving the config file
to phpmyadmin directory and deleting the directory config. But when I try to log in I get this error
#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).

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
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
- 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

I will be grateful for your help!
Thank you!

Jerry Stuckle

unread,
Jul 11, 2016, 9:48:55 AM7/11/16
to
On 7/11/2016 7:16 AM, Alla wrote:
> Hello!
> My system Mac os x 10.7
>
> I am new to php (and programming, currently learning basics of C). I have trouble setting up
> phpmyadmin. I have followed all necessary steps, including the last one of moving the config file
> to phpmyadmin directory and deleting the directory config. But when I try to log in I get this error
> #2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).
>
> Here are the steps I have taken:
<snip>

This isn't a PHP question. You should be asking in the PHPMyAdmin
support channels. They know their product better than anyone else.

--
==================
Remove the "x" from my email address
Jerry Stuckle
jstu...@attglobal.net
==================

alla.ra...@gmail.com

unread,
Jul 11, 2016, 12:18:02 PM7/11/16
to
I see. Thank you.

Gordon Burditt

unread,
Jul 11, 2016, 8:54:08 PM7/11/16
to
> #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


(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.

(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.


(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.

(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.

(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.

(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.

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.


> 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.

> 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?

> - 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.

Jerry Stuckle

unread,
Jul 11, 2016, 9:08:15 PM7/11/16
to
On 7/11/2016 8:53 PM, Gordon Burditt wrote:
>> #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?

>
> (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.

> (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.

>
> (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.

> (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.

> (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.

> (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.

> 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.

>
>> 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.

>> 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.

>> - 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".

Gordon Burditt

unread,
Jul 12, 2016, 5:55:52 AM7/12/16
to
>>> #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.

Jerry Stuckle

unread,
Jul 12, 2016, 8:35:25 AM7/12/16
to
Which should have been handled by his distro.

>>> (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.
>

Then he needs to be discussing this with the people who wrote the
installation instructions. If those instructions are wrong, they need
to be corrected.

>>> (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.
>

Which is obviously wrong, since he followed the instructions in
installing PHPMyAdmin.

> There's a difference between two identical copies of the MySQL client
> library in different places and two different versions of it.
>

There is? Gee, I don't think anyone here knew that!

>>> (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.
>

Then he should have followed the appropriate instructions.

>>
>>> (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?
>

That's true. So he needs to be discussing this with the PHPMyAdmin
people - who's instructions he followed. If those instructions are
wrong, then there's a problem.

And what ever gave you the idea I thought he was lying about the
problem? I directed him to where he can get the most help - instead of
randomly changing things and screwing up his system even more as you
have suggested.

>
>>> (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.
>

That's true. But you don't know what the right answer is, so you give
him a bunch of random things to change - and a great chance to totally
screw up his system.

>>> (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.
>

That's true. But you don't know what the right answer is, so you give
him a bunch of random things to change - and a great chance to totally
screw up his system.

>>> 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.
>

And which of the potentially multiple files should he change? I've seen
as many as a half dozen php.ini files on a system, and three or four
my.cnf files. Most are left over from the random changes like you are
suggesting.

>>>> 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.
>

You earlier said you used the values from the PHPMyAdmin. Which is it?

>>>> 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.
>

So he needs to be discussing this with the PHPMyAdmin people - who's
instructions he followed. If those instructions are wrong, then there's
a problem.

>>
>>>> - 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.
>

No, but they can help him with PROPERLY determining the problem -
instead of making random changes like you suggest.

Your response is *exactly* why I suggested he get help from people who
have seen this problem and should *know* what the solution is.

Alla

unread,
Jul 14, 2016, 7:37:52 AM7/14/16
to
Thank you very much for your detailed answer. I am not snipping it
for the reference. I assume that php knows where the socket is because
now, as I have reinstalled mysql and have started it all over again,
whatever action I perform I get another error message:

1) when I try to log in to phpmyadmin and enter the login name and password,
I get two error messages:

#1045 - Access denied for user '~Alla'@'localhost' (using password: YES)

and below
mysqli_real_connect(): (HY000/1045): Access denied for user '~Alla'@'localhost' (using password: YES)

But mysql server is running, which is indicated in the system preferences.

2) mysql start command from the Terminal returns the same error message:
ERROR 1045 (28000): Access denied for user 'Alla'@'localhost' (using password: NO)

I have spent half of the day today, the whole day yesterday searching the net to solve
this but to no avail. I am a newbie, and I am at my wit's end )

Here is a bit of history of how I have reinstalled mysql and checked if
it's working (the previous one has been uninstalled with usual set of commands, and
I have even checked manually all those folders to make sure none of the previous files
are there before reinstalling the new one):

1) /usr/local/mysql/bin/mysql -v

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 119
Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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.

Reading history-file /Users/Alla/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Writing history-file /Users/Alla/.mysql_history
Bye

2) cd ; nano .bash_profile

3) source ~/.bash_profile

4) mysql -v

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 167
Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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.

Reading history-file /Users/Alla/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> \q
Writing history-file /Users/Alla/.mysql_history
Bye

5) sudo mysql_secure_installation
Password:



NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!


By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!




All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!


Cleaning up...

6) mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 287
Server version: 5.6.20 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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> \q
Bye


After all these steps (see, I have checked a few times that mysql does work),
I have restarted the computer, made sure mysql server is running, restarted
apache, and then tried to log in to the phpmyadmin again. Got those error
messages I have named at the beginning of this post.

I will be grateful for your help on this!

Alla

unread,
Jul 14, 2016, 7:41:51 AM7/14/16
to
<snip>
Jerry, do you think that posting this on stack overflow would be correct?
They do not offer any other options, that is why I have tried here because
it is a group of professional php developers.
https://www.phpmyadmin.net/support/

Sorry for bothering with this issue.

Jerry Stuckle

unread,
Jul 14, 2016, 11:00:14 AM7/14/16
to
Alla, this is a newsgroup for questions on the PHP language, not
products written in PHP.

Would you ask questions about Windows in a C newsgroup? Windows was
written in C, after all.

When dealing with a product, your best place to start is the support
structure for that product. They know it better than anyone else.

Jerry Stuckle

unread,
Jul 14, 2016, 11:01:43 AM7/14/16
to
On 7/14/2016 7:37 AM, Alla wrote:
> On Tuesday, July 12, 2016 at 4:54:08 AM UTC+4, Gordon Burditt wrote:
>
> 1) when I try to log in to phpmyadmin and enter the login name and password,
> I get two error messages:
>
> #1045 - Access denied for user '~Alla'@'localhost' (using password: YES)
>
> and below
> mysqli_real_connect(): (HY000/1045): Access denied for user '~Alla'@'localhost' (using password: YES)
>
> But mysql server is running, which is indicated in the system preferences.
>

PHP is not MySQL!

Alla

unread,
Jul 14, 2016, 12:03:48 PM7/14/16
to
On Thursday, July 14, 2016 at 7:00:14 PM UTC+4, Jerry Stuckle wrote:
> On 7/14/2016 7:41 AM, Alla wrote:
> > <snip>
> > Jerry, do you think that posting this on stack overflow would be correct?
> > They do not offer any other options, that is why I have tried here because
> > it is a group of professional php developers.
> > https://www.phpmyadmin.net/support/
> >
> > Sorry for bothering with this issue.
> >
>
> Alla, this is a newsgroup for questions on the PHP language, not
> products written in PHP.
>
> Would you ask questions about Windows in a C newsgroup? Windows was
> written in C, after all.
>
> When dealing with a product, your best place to start is the support
> structure for that product. They know it better than anyone else.
>
I got it. I agree with you, and I am sorry for coming here with these
questions - indeed, they are inappropriate here. I am just not yet
aware of how AMP work together. I will do my best to solve setup
issues to start finally coding ) Thank you for your patience.

Jerry Stuckle

unread,
Jul 14, 2016, 1:24:54 PM7/14/16
to
Alla,

PHP setup questions are fine. This is the best place for those, and
we'll try to help with them.

J.O. Aho

unread,
Jul 15, 2016, 2:32:08 AM7/15/16
to
On 07/15/16 01:37, Gordon Burditt wrote:
> This belongs in comp.databases.mysql, not comp.lang.php.

Do you know if the OP do subscribe to c.d.m? You at least cross post and
in worst case you may set followup-to, but then you tell that, for you
still loose major input as people may not always subscribe to the
followup-to newsgroup.


>> 1) when I try to log in to phpmyadmin and enter the login name and password,
>> I get two error messages:
>>
>> #1045 - Access denied for user '~Alla'@'localhost' (using password: YES)
>
> Does your user name *REALLY* begin with a tilde? Are you sure about
> that? It's apparent that your home directory is *not* /Users/~Alla , so
> where did the tilde come from?
>
>> mysqli_real_connect(): (HY000/1045): Access denied for user '~Alla'@'localhost' (using password: YES)
>
> You may need to re-do the configuration of phpMyAdmin if you gave it
> a username beginning with a tilde to log into MySQL.
>
> Do the environment variables $USER or $LOGNAME have your user name in it
> beginning with a tilde? If so, fix that.
>
>> But mysql server is running, which is indicated in the system preferences.
>
> If the server says "Access Denied", chances are VERY good it's running.
>
>> 2) mysql start command from the Terminal returns the same error message:
>> ERROR 1045 (28000): Access denied for user 'Alla'@'localhost' (using password: NO)
>
> There's no tilde in that one!

No password, add -p to the command line.


> Does your (MySQL) account have a password? Did you supply a password?
> (hint: using password: NO) What do you think is supposed to happen
> when you don't supply a required password? How do you think you
> might fix the problem of not supplying a required password (on
> a shell command line)? If you know how to teach Terminal to use a
> different command line to start MySQL? If so, you might try that.
>
> It is possible (and recommended) to put information in your home
> directory to hand the client utilities ('mysql', 'mysqldump',
> 'mysqladmin', etc.) a default server hostname, username, and password
> by default. A better way appeared in mysql 5.6.6. This involves
> .my.cnf or .mylogin.cnf files in your home directory. This is more
> secure than putting a password on the command line, and permits
> running them in batch shell scripts without being prompted for the
> password a lot. I'm not going to give details here.

Unless the password in the configuration file is encrypted, it do not
add any security over using -p (without supplying the password) in the
command line, the only way to get hold of the password would be a
keylogger when you use -p (without supplying the password).

> I am intentionally not giving click-by-click instructions to do
> this. You need to read some documentation on option files for
> configuring *CLIENT* (not server) programs.
>
>
> You ran the security script to delete anonymous access to MySQL.
> You did at some point create a user Alla, right?
>

--

//Aho

Alla

unread,
Jul 16, 2016, 11:59:50 AM7/16/16
to
Jerry, thank you very very much!

praid...@gmail.com

unread,
Aug 17, 2016, 5:55:43 AM8/17/16
to
On Monday, July 11, 2016 at 1:16:30 PM UTC+2, Alla wrote:

Hey Alla,

1. Delete everything you installed.
2. Download a file called 'xampplite-win32-1.7.3.exe' (easy to find via Google)
3. Install it
4. Everything will be where everything else expects it to be... and everything will work... the first time you try.

[FYI - this is a controlled installation file that installs Apache Server, MySQL & PHP. IOW - everything you need to run what it sounds like you need to run]

Good luck and best wishes, this sw can do really amazing stuff.
Peter Butler
Johannesburg

buttle

unread,
Aug 17, 2016, 6:03:44 AM8/17/16
to
Ooops!

Mac osx10...

make that: download XAMPPLITE for MAC

cheers
PB

Jerry Stuckle

unread,
Aug 18, 2016, 12:15:44 PM8/18/16
to
On 8/17/2016 5:55 AM, praid...@gmail.com wrote:
> On Monday, July 11, 2016 at 1:16:30 PM UTC+2, Alla wrote:
>
> Hey Alla,
>
> 1. Delete everything you installed.
> 2. Download a file called 'xampplite-win32-1.7.3.exe' (easy to find via Google)
> 3. Install it
> 4. Everything will be where everything else expects it to be... and everything will work... the first time you try.
>
> [FYI - this is a controlled installation file that installs Apache Server, MySQL & PHP. IOW - everything you need to run what it sounds like you need to run]
>
> Good luck and best wishes, this sw can do really amazing stuff.
> Peter Butler
> Johannesburg
>

And learn exactly nothing about the proper way to install and configure
various products.

It's harder at the start to install the products individually, but you
learn much and are more knowledgeable when you need to install or
configure something outside of the supplied one.

Härra Rabmo

unread,
Jul 8, 2022, 9:47:45 AM7/8/22
to
HEY !!!!!!!!!!!!!!!! WANT TO TALK WITH SOMEONE ???????????????????
CALL MY NUMBER THEN !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



*******************************************************
*******************************************************
✆☎☏📱📞 : 372 53900660
0 new messages