'\"macro stdmacro .\" .\" Copyright (c) 2014,2017 Red Hat. .\" Copyright (c) 2012-2013 Chandana De Silva. .\" Copyright (c) 2008 Aconex. All Rights Reserved. .\" .\" This program is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by the .\" Free Software Foundation; either version 2 of the License, or (at your .\" option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but .\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY .\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" for more details. .\" .TH PMDAMYSQL 1 "PCP" "Performance Co-Pilot" .SH NAME \f3pmdamysql\f1 \- MySQL and MariaDB database PMDA .SH DESCRIPTION \f3pmdamysql\f1 is a Performance Co-Pilot \s-1PMDA\s0 which extracts live performance data from a running MySQL or MariaDB database. .SH INSTALLATION \f3pmdamysql\f1 uses a configuration file from (in this order): .IP "\(bu" 4 /etc/pcpdbi.conf .IP "\(bu" 4 \&\f(CR$PCP_PMDAS_DIR\fR/mysql/mysql.conf .PP This file can contain overridden values (Perl code) for the settings listed at the start of pmdamysql.pl, namely: .IP "\(bu" 4 database name (see \s-1\fIDBI\s0\fR\|(3) for details, default is "DBI:mysql:mysql") .IP "\(bu" 4 database username (default is "dbmonitor") .IP "\(bu" 4 database password (default is "dbmonitor") .IP "\(bu" 4 login account (default is "pcp") .PP On some versions of MariaDB (10+) the performance schema is disabled by default, and must be enabled for the PMDA to function. This is achieved by adding the string "performance_schema" into the "[mysqld]" section of the MariaDB configuration file (either .I my.cnf or .IR my.ini ). The "SHOW ENGINES" SQL statement shows support for the performance schema. .PP Once these initial setup actions are complete, you can access the names and values for the mysql performance metrics by doing the following as root: .sp 1 .RS +4 .ft B .nf # cd $PCP_PMDAS_DIR/mysql # ./Install .fi .ft P .RE .sp 1 To uninstall, the following must be done as root: .sp 1 .RS +4 .ft B .nf # cd $PCP_PMDAS_DIR/mysql # ./Remove .fi .ft P .RE .sp 1 \fBpmdamysql\fR is launched by \fIpmcd\fR(1) and should never be executed directly. The Install and Remove scripts notify \fIpmcd\fR(1) when the agent is installed or removed. .SH "Binary Status values in text" Some of the status values are in the form of \s-1YES/NO\s0 or \s-1ON/OFF\s0. .PP Since these cannot be interpreted by tools like .BR pmie (1), they have been duplicated with a _num extension and the values of 1 (\s-1YES/ON\s0) or 0 (\s-1NO/OFF\s0). .SS "Eg:" .IX Subsection "Eg:" .IP "\(bu" 4 mysql.slave_status.slave_io_running .IP "\(bu" 4 mysql.slave_status.slave_io_running_num .SH FILES .IP "\fB/etc/pcpdbi.conf\fR" 4 configuration file for all \s-1PCP\s0 database monitors .ie n .IP "\fB$PCP_PMDAS_DIR/mysql/mysql.conf\f1" 4 .el .IP "\f(CR$PCP_PMDAS_DIR\fR/mysql/mysql.conf\f1" 4 configuration file for \fBpmdamysql\fR .IP "\fB$PCP_PMDAS_DIR/mysql/Install\fR" 4 installation script for the \fBpmdamysql\fR agent .IP "\fB$PCP_PMDAS_DIR/mysql/Remove\fR" 4 undo installation script for the \fBpmdamysql\fR agent .IP "\fB$PCP_LOG_DIR/pmcd/mysql.log\fR" 4 default log file for error messages from \fBpmdamysql\fR .SH PCP ENVIRONMENT Environment variables with the prefix \fBPCP_\fR are used to parameterize the file and directory names used by \fBPCP\fR. On each installation, the file \fB/etc/pcp.conf\fR contains the local values for these variables. The \fB$PCP_CONF\fR variable may be used to specify an alternative configuration file, as described in \fIpcp.conf\fR(5). .SH SEE ALSO .BR PCPIntro (1), .BR pmcd (1), .BR pmdadbping (1), .BR pmie (1) and .BR DBI (3).