unix socekts vs port 3306 - to connect tol mysql-server: how to deal with this

hello dear opensuse-community

  • because of the sockets that connect to mysql-db

we ve got unixsocket on the server that connect to the mysql-db

/home/vhost/WWW/var/run/mysql/mysql.sock

i follow this instrucitons on the server: http://wiki.jobberbase.com/install/guide-for-apache

within the configuration the db port is metioned .
>
>
> // mysql credentials
> ‘db_host’ => ‘localhost’,
> ‘db_port’ => 3306,
> ‘db_user’ => ‘root’,
> ‘db_password’ => ‘’,

my server admin told me that SQL did not run over TCP - here. we allway used and will use
UNIX-Socket

does this mean that i have to do the edit like so

>
> // mysql credentials
> ‘db_host’ => ‘localhost’,
> ‘db_port’ => '/home/vhost/WWW/var/run/mysql/mysql.sock,
> ‘db_user’ => ‘root’,
> ‘db_password’ => ‘’,

love to hear from you

note: i follow this instrucitons on the server: http://wiki.jobberbase.com/install/guide-for-apache

According to the MariaDB documentation, the value of port may be anything from 0 to 65535; 3306 is simply the default. There is discussion in the documentation of how to handle conflicts between Unix sockets and TCP posts in Starting and stopping.

@dilbertone
You’re on the right track. @john_hudson is describing TCP/IP setup which doesn’t apply in your case.
I’ll be honest, although I’ve set up several apps to connect to MySQL using UNIX sockets, I’ve never configured an Apache, I’ve always configured a TCP/IP connection instead and IMO that’s pretty much standard for any deployment which might want to maintain flexibility to deploy the webserver on a different machine and maybe even eventually upgrade to a webserver farm.

A likely important thing to consider is that Apache has undergone some substantial changes recently going to 2.0 and now to 2.4(or even later).
Assuming that you’re running 2.4, a Google search returns a number of hits, many of which suggest that your unix sockets configuration may need to be configured in one of the Apache modules configs, and only you know what your website requires so I can’t specify exactly what config to modify.

My Google search

apache 2.4 documentation set up unix sockets

Aside from that, I’d also recommend you verify your mysql is running properly using named sockets.
This can usually be done easily by simply running mysql admin in a local console.
I’d also strongly suspect that no Administrator password should be specified (or set to null).
And, when you finally hit on the correct setup, everything will “just work.” UNIX sockets(at least for local IPC) is pretty simple without any real configuration.

TSU

many thanks you both.

thanks for all these in depth going ideas & considerations.

after lots of struggle with the db and some issues with webmin now all the things go well

and the site is running well no the server

i ve looked at the file - what is entered now;

'db_port' => 3306,

somewhat funny - since this is obviously a tcp-ip technique

well very very interesting… or what do you say?