Re: [RCU] Connecting to MySQL via unix socket

2012-11-22 Thread Reindl Harald


Am 22.11.2012 11:32, schrieb Mark Constable:
> Is it possible to connect to MySQL via a unix socket?
> 
> If so, what would be the exact db_dsnw example when my.cnf is set to...
> 
> socket = /var/run/mysqld/mysqld.sock
> 
> and my current config/db.inc.php contains...
> 
> $rcmail_config['db_dsnw'] = 'mysql://rcadmin:XXX@localhost/roundcubemail';

localhost IS unix-socket
127.0.0.1 is TCP/IP



signature.asc
Description: OpenPGP digital signature
___
Roundcube Users mailing list
users@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/users

Re: [RCU] Connecting to MySQL via unix socket

2012-11-22 Thread Kaz Kylheku

On Thu, 22 Nov 2012 11:34:56 +0100, Reindl Harald
 wrote:
> Am 22.11.2012 11:32, schrieb Mark Constable:
>> Is it possible to connect to MySQL via a unix socket?
>>
>> If so, what would be the exact db_dsnw example when my.cnf is set to...
>>
>> socket = /var/run/mysqld/mysqld.sock
>>
>> and my current config/db.inc.php contains...
>>
>> $rcmail_config['db_dsnw'] = 
>> 'mysql://rcadmin:XXX@localhost/roundcubemail';
> 
> localhost IS unix-socket
> 127.0.0.1 is TCP/IP

"Unix sockets" is sometimes understood to refer to something else:
sockets in the AF_UNIX address family, rather than AF_INET.

The contact points for Unix sockets are not network addresses,
but rather paths in the file system, often placed in /tmp or /var/tmp
by convention.

A pair of unnamed, connected sockets can also be created
with the socketpair function.

___
Roundcube Users mailing list
users@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/users


Re: [RCU] Connecting to MySQL via unix socket

2012-11-22 Thread Reindl Harald


Am 22.11.2012 16:54, schrieb Kaz Kylheku:
> 
> On Thu, 22 Nov 2012 11:34:56 +0100, Reindl Harald
>  wrote:
>> Am 22.11.2012 11:32, schrieb Mark Constable:
>>> Is it possible to connect to MySQL via a unix socket?
>>>
>>> If so, what would be the exact db_dsnw example when my.cnf is set to...
>>>
>>> socket = /var/run/mysqld/mysqld.sock
>>>
>>> and my current config/db.inc.php contains...
>>>
>>> $rcmail_config['db_dsnw'] = 
>>> 'mysql://rcadmin:XXX@localhost/roundcubemail';
>>
>> localhost IS unix-socket
>> 127.0.0.1 is TCP/IP
> 
> "Unix sockets" is sometimes understood to refer to something else:
> sockets in the AF_UNIX address family, rather than AF_INET.
> 
> The contact points for Unix sockets are not network addresses,
> but rather paths in the file system, often placed in /tmp or /var/tmp
> by convention.
> 
> A pair of unnamed, connected sockets can also be created
> with the socketpair function.

you do not need to explain me the generic details

in the context of mysql / php it is and was always
the switch localhost / 127.0.0.1 and that is why
there is also a difference in grant-tables for both
where you can make different rules for TCP and Socket

try it out!



signature.asc
Description: OpenPGP digital signature
___
Roundcube Users mailing list
users@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/users

Re: [RCU] Connecting to MySQL via unix socket

2012-11-22 Thread Mark Constable
Am 22.11.2012 11:32, schrieb Mark Constable:
>> socket = /var/run/mysqld/mysqld.sock
>> $rcmail_config['db_dsnw'] = 
>> 'mysql://rcadmin:XXX@localhost/roundcubemail';
>
> localhost IS unix-socket
> 127.0.0.1 is TCP/IP

Right, so somehow RC via PHP knows exactly where my particular MySQL
socket path is then?

Some other applications I use need the path to the socket explicitly
defined in their configs.
___
Roundcube Users mailing list
users@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/users


Re: [RCU] Connecting to MySQL via unix socket

2012-11-22 Thread Reindl Harald


Am 22.11.2012 07:19, schrieb Mark Constable:
> Am 22.11.2012 11:32, schrieb Mark Constable:
>>> socket = /var/run/mysqld/mysqld.sock
>>> $rcmail_config['db_dsnw'] = 
>>> 'mysql://rcadmin:XXX@localhost/roundcubemail';
>>
>> localhost IS unix-socket
>> 127.0.0.1 is TCP/IP
> 
> Right, so somehow RC via PHP knows exactly where my particular MySQL
> socket path is then?

if your server is properly configured YES

on fedora any mysql/php default is the same location
and it works out of the box, with weird packages
configure PHP correct to the same path as mysqld

mysql.default_socket  = "/var/lib/mysql/mysql.sock"
mysqli.default_socket = "/var/lib/mysql/mysql.sock"

it is common for any web-application that it relies
on basic configuration like this is done from whoever
has installed the software



signature.asc
Description: OpenPGP digital signature
___
Roundcube Users mailing list
users@lists.roundcube.net
http://lists.roundcube.net/mailman/listinfo/users