RE: mysqli connection problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> > Hello,
> >
> > This question was asked many times, but I can't find a good answer.
> > I am getting this error message while trying to connect to MySQL server
> (PHP
> > + PEAR::DB_DataObject):
> >
> > "Can't connect to local MySQL server through socket '' (111)"
> >
> > (notice '' - is that right?)
> >
> > Does anyone have any ideas about how to get rid of this error?
> >
> > Configuration:
> > * RedHat Enterprise Linux AS3
> > * Apache 2.0.46
> > * PHP 5.0.2
> > * MySQL 4.1.9, mysqli ext.
> >
> > Thanks!
> 
> [Note: reply-to set to php-db as it's multimailed and I don't see this
> as a mysql general issue, nor php general, but feh.]

Well, I don't know the possible reasons for this, so I mailed it to all
suitable lists.

> 
> Looks to be set blank/null/etc.
> 
> You may be slightly tricked by the existence of both of these - from
> your standard php.ini...
> -----
> ; Default socket name for local MySQL connects.  If empty, uses the built-
> in
> mysql.default_socket =
> 
> ; Default socket name for local MySQL connects.  If empty, uses the built-
> in
> ; MySQL defaults.
> mysqli.default_socket =

Didn't help me. MySQL socket does exist - /var/lib/mysql/mysql.sock (default
location).
mysqli.default_socket is NOT set to null but to this value (manually, as you
advised)

Again,

1. Connection to localhost still fails with message "Can't connect to local
MySQL server through socket '' (111)"

2. Connection to server's domain name fails too (!) with message "Access
denied for user 'user'@'example.com' (using password: YES)"

3. Connection to localhost through mysql shows the following config

mysql> status
--------------
mysql  Ver 14.7 Distrib 4.1.9, for pc-linux-gnu (i686)

Connection id:          42
Current database:
Current user:           root@localhost
SSL:                    Not in use
Current pager:          stdout
Using outfile:          ''
Using delimiter:        ;
Server version:         4.1.9-standard
Protocol version:       10
Connection:             Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
UNIX socket:            /var/lib/mysql/mysql.sock
Uptime:                 1 day 3 hours 1 min 7 sec

Threads: 3  Questions: 272  Slow queries: 0  Opens: 64  Flush tables: 1
Open tables: 26  Queries per second avg: 0.003
--------------

Seems to be a security issue... Any more ideas about these symptoms?

> -----
> I can't see any reason why you wouldn't be able to use the same socket -
> you're connecting to the same exact server, it's just a path.  You
> should be perfectly able to set your mysqli.default_socket to the same
> as the mysql.default_socket.  I can't tell you what the default for your
> system is, but there are php functions to get configuration options, if
> you don't have it in any obvious places.
> 
> Cheers,
> --
> - Martin Norland, Database / Web Developer, International Outreach x3257
> The opinion(s) contained within this email do not necessarily represent
> those of St. Jude Children's Research Hospital.
> 
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=denis.gerasimov@xxxxxxxx

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux