ss_get_mysql_stats.php usage update about socket use
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Monitoring Plugins |
Fix Released
|
Low
|
Unassigned |
Bug Description
Version 1.0.4
PHP version 5.3.21
Hello,
I feel like using socket only does work with this script.
Test 1: Works with tcp/ip
$ php scripts/
Returns
gg:216446 gh:84 gi:60514 gj:2450
Test 2: Work with socket and version 1.0.0
$ php scripts/
NB: The values returned don't correspond to the same parameters but it's not so important
Test 3: Doesn't work with socket and version 1.0.4
$ php scripts/
It fails here in the script
$conn = mysqli_connect('', $user, $pass,'
if ( !$conn ) {
debug("MySQL connection failed: " . mysqli_
printf(
printf(
die("MySQL: " . mysqli_
}
The script returns
Connect failed: Unknown MySQL server host ':/var/
$ ls -l /var/run/
srwxrwxrwx 1 502 1 0 Aug 13 08:21 /var/run/
My conlusions are:
Test 1: My credentials are correct and I'm able to access the database through tcp/ip and with mysqli
Test 2: My credentials are correct and I'm able to access the database through my socket and with mysql
Test 3: Using a socket doesn't seem work with mysqli, it doesn't accept ':/var/
I have not found the final solution.
Regards
tags: | added: cacti mysql |
Changed in percona-monitoring-plugins: | |
status: | Confirmed → Fix Committed |
tags: | added: docs |
Changed in percona-monitoring-plugins: | |
milestone: | none → 1.0.5 |
Changed in percona-monitoring-plugins: | |
status: | Fix Committed → Fix Released |
Hi,
http:// php.net/ manual/ en/mysqli. construct. php
host
Can be either a host name or an IP address. Passing the NULL value or the string "localhost" to this parameter, the local host is assumed. When possible, pipes will be used instead of the TCP/IP protocol.
socket
Specifies the socket or named pipe that should be used.
Note:
Specifying the socket parameter will not explicitly determine the type of connection to be used when connecting to the MySQL server. How the connection is made to the MySQL database is determined by the host parameter.
If you specify the host == 'localhost', the php script should use the socket.
A hostname of 'localhost' makes it to use the local socket.