{"id":20849,"date":"2022-09-27T09:11:18","date_gmt":"2022-09-27T09:11:18","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=20849"},"modified":"2023-09-12T11:24:29","modified_gmt":"2023-09-12T11:24:29","slug":"how-to-setup-datadog-agent-integration-with-mysql-to-collect-many-metrics-from-mysql-databases","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-setup-datadog-agent-integration-with-mysql-to-collect-many-metrics-from-mysql-databases\/","title":{"rendered":"Datadog Tutorials: Datadog Agent integration with mysql databases?"},"content":{"rendered":"\n<p><strong>How to setup Datadog Agent integration with mysql to collect many metrics from MySQL databases?<\/strong><\/p>\n\n\n\n<p>The Datadog Agent can collect many metrics from MySQL databases, including (but not limited to):<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Query throughput<\/li>\n\n\n\n<li>Query performance (e.g. average query run time, slow queries, etc.)<\/li>\n\n\n\n<li>Connections (e.g. currently open connections, aborted connections, errors, etc.)<\/li>\n\n\n\n<li>InnoDB (e.g. buffer pool metrics, etc.)<\/li>\n<\/ul>\n\n\n\n<p>You can also create your own metrics using custom SQL queries.<\/p>\n\n\n\n<p><strong>The following metrics will be tracked by this integration:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Name<\/th><th>Units<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>mysql.binlog.cache_disk_use<\/td><td>transactions<\/td><td>The number of transactions that used the temporary binary log cache but that exceeded the value of binlog_cache_size and used a temporary file to store statements from the transaction.<\/td><\/tr><tr><td>mysql.binlog.cache_use<\/td><td>transactions<\/td><td>The number of transactions that used the binary log cache.<\/td><\/tr><tr><td>mysql.binlog.disk_use<\/td><td>bytes<\/td><td>Total binary log file size.<\/td><\/tr><tr><td>mysql.galera.wsrep_cert_deps_distance<\/td><td><\/td><td>Shows the average distance between the lowest and highest sequence number, or seqno, values that the node can possibly apply in parallel.<\/td><\/tr><tr><td>mysql.galera.wsrep_cluster_size<\/td><td>nodes<\/td><td>The current number of nodes in the Galera cluster.<\/td><\/tr><tr><td>mysql.galera.wsrep_flow_control_paused<\/td><td>fractions<\/td><td>Shows the fraction of the time, since FLUSH STATUS was last called, that the node paused due to Flow Control.<\/td><\/tr><tr><td>mysql.galera.wsrep_flow_control_paused_ns<\/td><td>nanoseconds<\/td><td>Shows the pause time due to Flow Control, in nanoseconds.<\/td><\/tr><tr><td>mysql.galera.wsrep_flow_control_recv<\/td><td><\/td><td>Shows the number of times the galera node has received a pausing Flow Control message from others<\/td><\/tr><tr><td>mysql.galera.wsrep_flow_control_sent<\/td><td><\/td><td>Shows the number of times the galera node has sent a pausing Flow Control message to others<\/td><\/tr><tr><td>mysql.galera.wsrep_local_recv_queue_avg<\/td><td><\/td><td>Shows the average size of the local received queue since the last status query.<\/td><\/tr><tr><td>mysql.galera.wsrep_local_send_queue_avg<\/td><td><\/td><td>Show an average for the send queue length since the last FLUSH STATUS query.<\/td><\/tr><tr><td>mysql.info.schema.size<\/td><td>mebibytes<\/td><td>Size of schemas in MiB<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_data<\/td><td>bytes<\/td><td>The total number of bytes in the InnoDB buffer pool containing data. The number includes both dirty and clean pages.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_dirty<\/td><td>bytes<\/td><td>The total current number of bytes held in dirty pages in the InnoDB buffer pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_free<\/td><td>pages<\/td><td>The number of free pages in the InnoDB Buffer Pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_pages_data<\/td><td>pages<\/td><td>The number of pages in the InnoDB buffer pool containing data. The number includes both dirty and clean pages.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_pages_dirty<\/td><td>pages<\/td><td>The current number of dirty pages in the InnoDB buffer pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_pages_flushed<\/td><td>pages\/second<\/td><td>The number of requests to flush pages from the InnoDB buffer pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_pages_free<\/td><td>pages<\/td><td>The number of free pages in the InnoDB buffer pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_pages_total<\/td><td>pages<\/td><td>The total size of the InnoDB buffer pool, in pages.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_read_ahead<\/td><td>pages\/second<\/td><td>The number of pages read into the InnoDB buffer pool by the read-ahead background thread.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_read_ahead_evicted<\/td><td>pages\/second<\/td><td>The number of pages read into the InnoDB buffer pool by the read-ahead background thread that were subsequently evicted without having been accessed by queries.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_read_ahead_rnd<\/td><td>operations<\/td><td>The number of random read-aheads initiated by InnoDB. This happens when a query scans a large portion of a table but in random order.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_read_requests<\/td><td>reads\/second<\/td><td>The number of logical read requests.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_reads<\/td><td>reads\/second<\/td><td>The number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from disk.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_total<\/td><td>pages<\/td><td>The total number of pages in the InnoDB Buffer Pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_used<\/td><td>pages<\/td><td>The number of used pages in the InnoDB Buffer Pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_utilization<\/td><td>fractions<\/td><td>The utilization of the InnoDB Buffer Pool.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_wait_free<\/td><td>waits<\/td><td>When InnoDB needs to read or create a page and no clean pages are available, InnoDB flushes some dirty pages first and waits for that operation to finish. This counter counts instances of these waits.<\/td><\/tr><tr><td>mysql.innodb.buffer_pool_write_requests<\/td><td>writes\/second<\/td><td>The number of writes done to the InnoDB buffer pool.<\/td><\/tr><tr><td>mysql.innodb.checkpoint_age<\/td><td><\/td><td>Checkpoint age as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.current_row_locks<\/td><td>locks<\/td><td>The number of current row locks.<\/td><\/tr><tr><td>mysql.innodb.current_transactions<\/td><td>transactions<\/td><td>Current InnoDB transactions<\/td><\/tr><tr><td>mysql.innodb.data_fsyncs<\/td><td>operations\/second<\/td><td>The number of fsync() operations per second.<\/td><\/tr><tr><td>mysql.innodb.data_pending_fsyncs<\/td><td>operations<\/td><td>The current number of pending fsync() operations.<\/td><\/tr><tr><td>mysql.innodb.data_pending_reads<\/td><td>reads<\/td><td>The current number of pending reads.<\/td><\/tr><tr><td>mysql.innodb.data_pending_writes<\/td><td>writes<\/td><td>The current number of pending writes.<\/td><\/tr><tr><td>mysql.innodb.data_read<\/td><td>bytes\/second<\/td><td>The amount of data read per second.<\/td><\/tr><tr><td>mysql.innodb.data_reads<\/td><td>reads\/second<\/td><td>The rate of data reads.<\/td><\/tr><tr><td>mysql.innodb.data_writes<\/td><td>writes\/second<\/td><td>The rate of data writes.<\/td><\/tr><tr><td>mysql.innodb.data_written<\/td><td>bytes\/second<\/td><td>The amount of data written per second.<\/td><\/tr><tr><td>mysql.innodb.dblwr_pages_written<\/td><td>pages\/second<\/td><td>The number of pages written per second to the doublewrite buffer.<\/td><\/tr><tr><td>mysql.innodb.dblwr_writes<\/td><td>bytes\/second<\/td><td>The number of doublewrite operations performed per second.<\/td><\/tr><tr><td>mysql.innodb.hash_index_cells_total<\/td><td><\/td><td>Total number of cells of the adaptive hash index<\/td><\/tr><tr><td>mysql.innodb.hash_index_cells_used<\/td><td><\/td><td>Number of used cells of the adaptive hash index<\/td><\/tr><tr><td>mysql.innodb.history_list_length<\/td><td><\/td><td>History list length as shown in the TRANSACTIONS section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.ibuf_free_list<\/td><td><\/td><td>Insert buffer free list, as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.ibuf_segment_size<\/td><td><\/td><td>Insert buffer segment size, as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.ibuf_size<\/td><td><\/td><td>Insert buffer size, as shown in the INSERT BUFFER AND ADAPTIVE HASH INDEX section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.log_waits<\/td><td>waits\/second<\/td><td>The number of times that the log buffer was too small and a wait was required for it to be flushed before continuing.<\/td><\/tr><tr><td>mysql.innodb.log_write_requests<\/td><td>writes\/second<\/td><td>The number of write requests for the InnoDB redo log.<\/td><\/tr><tr><td>mysql.innodb.log_writes<\/td><td>writes\/second<\/td><td>The number of physical writes to the InnoDB redo log file.<\/td><\/tr><tr><td>mysql.innodb.lsn_current<\/td><td><\/td><td>Log sequence number as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.lsn_flushed<\/td><td><\/td><td>Flushed up to log sequence number as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.lsn_last_checkpoint<\/td><td><\/td><td>Log sequence number last checkpoint as shown in the LOG section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_adaptive_hash<\/td><td>bytes<\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_additional_pool<\/td><td>bytes<\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_dictionary<\/td><td>bytes<\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_file_system<\/td><td><\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_lock_system<\/td><td><\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_page_hash<\/td><td><\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_recovery_system<\/td><td><\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mem_total<\/td><td>bytes<\/td><td>As shown in the BUFFER POOL AND MEMORY section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.mutex_os_waits<\/td><td>events\/second<\/td><td>The rate of mutex OS waits.<\/td><\/tr><tr><td>mysql.innodb.mutex_spin_rounds<\/td><td>events\/second<\/td><td>The rate of mutex spin rounds.<\/td><\/tr><tr><td>mysql.innodb.mutex_spin_waits<\/td><td>events\/second<\/td><td>The rate of mutex spin waits.<\/td><\/tr><tr><td>mysql.innodb.os_log_fsyncs<\/td><td>writes\/second<\/td><td>The rate of fsync writes to the log file.<\/td><\/tr><tr><td>mysql.innodb.os_log_pending_fsyncs<\/td><td>operations<\/td><td>Number of pending InnoDB log fsync (sync-to-disk) requests.<\/td><\/tr><tr><td>mysql.innodb.os_log_pending_writes<\/td><td>writes<\/td><td>Number of pending InnoDB log writes.<\/td><\/tr><tr><td>mysql.innodb.os_log_written<\/td><td>bytes\/second<\/td><td>Number of bytes written to the InnoDB log.<\/td><\/tr><tr><td>mysql.innodb.pages_created<\/td><td>pages\/second<\/td><td>Number of InnoDB pages created.<\/td><\/tr><tr><td>mysql.innodb.pages_read<\/td><td>pages\/second<\/td><td>Number of InnoDB pages read.<\/td><\/tr><tr><td>mysql.innodb.pages_written<\/td><td>pages\/second<\/td><td>Number of InnoDB pages written.<\/td><\/tr><tr><td>mysql.innodb.pending_aio_log_ios<\/td><td><\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_aio_sync_ios<\/td><td><\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_buffer_pool_flushes<\/td><td>flushes<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_checkpoint_writes<\/td><td><\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_ibuf_aio_reads<\/td><td><\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_log_flushes<\/td><td>flushes<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_log_writes<\/td><td>writes<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_normal_aio_reads<\/td><td>reads<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.pending_normal_aio_writes<\/td><td>writes<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.queries_inside<\/td><td>queries<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.queries_queued<\/td><td>queries<\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.read_views<\/td><td><\/td><td>As shown in the FILE I\/O section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.row_lock_current_waits<\/td><td><\/td><td>The number of row locks currently being waited for by operations on InnoDB tables.<\/td><\/tr><tr><td>mysql.innodb.row_lock_time<\/td><td>fractions<\/td><td>Fraction of time spent (ms\/s) acquiring row locks.<\/td><\/tr><tr><td>mysql.innodb.row_lock_waits<\/td><td>events\/second<\/td><td>The number of times per second a row lock had to be waited for.<\/td><\/tr><tr><td>mysql.innodb.rows_deleted<\/td><td>rows\/second<\/td><td>Number of rows deleted from InnoDB tables.<\/td><\/tr><tr><td>mysql.innodb.rows_inserted<\/td><td>rows\/second<\/td><td>Number of rows inserted into InnoDB tables.<\/td><\/tr><tr><td>mysql.innodb.rows_read<\/td><td>rows\/second<\/td><td>Number of rows read from InnoDB tables.<\/td><\/tr><tr><td>mysql.innodb.rows_updated<\/td><td>rows\/second<\/td><td>Number of rows updated in InnoDB tables.<\/td><\/tr><tr><td>mysql.innodb.s_lock_os_waits<\/td><td>\/second<\/td><td>As shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output<\/td><\/tr><tr><td>mysql.innodb.s_lock_spin_rounds<\/td><td>\/second<\/td><td>As shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.s_lock_spin_waits<\/td><td>waits\/second<\/td><td>As shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.x_lock_os_waits<\/td><td>waits\/second<\/td><td>As shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.x_lock_spin_rounds<\/td><td><\/td><td>As shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.innodb.x_lock_spin_waits<\/td><td>waits<\/td><td>As shown in the SEMAPHORES section of the SHOW ENGINE INNODB STATUS output.<\/td><\/tr><tr><td>mysql.myisam.key_buffer_bytes_unflushed<\/td><td>bytes<\/td><td>MyISAM key buffer bytes unflushed.<\/td><\/tr><tr><td>mysql.myisam.key_buffer_bytes_used<\/td><td>bytes<\/td><td>MyISAM key buffer bytes used.<\/td><\/tr><tr><td>mysql.myisam.key_buffer_size<\/td><td>bytes<\/td><td>Size of the buffer used for index blocks.<\/td><\/tr><tr><td>mysql.myisam.key_read_requests<\/td><td>reads\/second<\/td><td>The number of requests to read a key block from the MyISAM key cache.<\/td><\/tr><tr><td>mysql.myisam.key_reads<\/td><td>reads\/second<\/td><td>The number of physical reads of a key block from disk into the MyISAM key cache. If Key_reads is large, then your key_buffer_size value is probably too small. The cache miss rate can be calculated as Key_reads\/Key_read_requests.<\/td><\/tr><tr><td>mysql.myisam.key_write_requests<\/td><td>writes\/second<\/td><td>The number of requests to write a key block to the MyISAM key cache.<\/td><\/tr><tr><td>mysql.myisam.key_writes<\/td><td>writes\/second<\/td><td>The number of physical writes of a key block from the MyISAM key cache to disk.<\/td><\/tr><tr><td>mysql.net.aborted_clients<\/td><td>connections\/second<\/td><td>The number of connections that were aborted because the client died without closing the connection properly.<\/td><\/tr><tr><td>mysql.net.aborted_connects<\/td><td>connections\/second<\/td><td>The number of failed attempts to connect to the MySQL server.<\/td><\/tr><tr><td>mysql.net.connections<\/td><td>connections\/second<\/td><td>The rate of connections to the server.<\/td><\/tr><tr><td>mysql.net.max_connections<\/td><td>connections<\/td><td>The maximum number of connections that have been in use simultaneously since the server started.<\/td><\/tr><tr><td>mysql.net.max_connections_available<\/td><td>connections<\/td><td>The maximum permitted number of simultaneous client connections.<\/td><\/tr><tr><td>mysql.performance.bytes_received<\/td><td>bytes\/second<\/td><td>The number of bytes received from all clients.<\/td><\/tr><tr><td>mysql.performance.bytes_sent<\/td><td>bytes\/second<\/td><td>The number of bytes sent to all clients.<\/td><\/tr><tr><td>mysql.performance.com_delete<\/td><td>queries\/second<\/td><td>The rate of delete statements.<\/td><\/tr><tr><td>mysql.performance.com_delete_multi<\/td><td>queries\/second<\/td><td>The rate of delete-multi statements.<\/td><\/tr><tr><td>mysql.performance.com_insert<\/td><td>queries\/second<\/td><td>The rate of insert statements.<\/td><\/tr><tr><td>mysql.performance.com_insert_select<\/td><td>queries\/second<\/td><td>The rate of insert-select statements.<\/td><\/tr><tr><td>mysql.performance.com_load<\/td><td>queries\/second<\/td><td>The rate of load statements.<\/td><\/tr><tr><td>mysql.performance.com_replace<\/td><td>queries\/second<\/td><td>The rate of replace statements.<\/td><\/tr><tr><td>mysql.performance.com_replace_select<\/td><td>queries\/second<\/td><td>The rate of replace-select statements.<\/td><\/tr><tr><td>mysql.performance.com_select<\/td><td>queries\/second<\/td><td>The rate of select statements.<\/td><\/tr><tr><td>mysql.performance.com_update<\/td><td>queries\/second<\/td><td>The rate of update statements.<\/td><\/tr><tr><td>mysql.performance.com_update_multi<\/td><td>queries\/second<\/td><td>The rate of update-multi.<\/td><\/tr><tr><td>mysql.performance.created_tmp_disk_tables<\/td><td>tables\/second<\/td><td>The rate of internal on-disk temporary tables created by second by the server while executing statements.<\/td><\/tr><tr><td>mysql.performance.created_tmp_files<\/td><td>files\/second<\/td><td>The rate of temporary files created by second.<\/td><\/tr><tr><td>mysql.performance.created_tmp_tables<\/td><td>tables\/second<\/td><td>The rate of internal temporary tables created by second by the server while executing statements.<\/td><\/tr><tr><td>mysql.performance.digest_95th_percentile.avg_us<\/td><td>microseconds<\/td><td>Query response time 95th percentile per schema.<\/td><\/tr><tr><td>mysql.performance.handler_commit<\/td><td>operations\/second<\/td><td>The number of internal COMMIT statements.<\/td><\/tr><tr><td>mysql.performance.handler_delete<\/td><td>operations\/second<\/td><td>The number of internal DELETE statements.<\/td><\/tr><tr><td>mysql.performance.handler_prepare<\/td><td>operations\/second<\/td><td>The number of internal PREPARE statements.<\/td><\/tr><tr><td>mysql.performance.handler_read_first<\/td><td>operations\/second<\/td><td>The number of internal READ_FIRST statements.<\/td><\/tr><tr><td>mysql.performance.handler_read_key<\/td><td>operations\/second<\/td><td>The number of internal READ_KEY statements.<\/td><\/tr><tr><td>mysql.performance.handler_read_next<\/td><td>operations\/second<\/td><td>The number of internal READ_NEXT statements.<\/td><\/tr><tr><td>mysql.performance.handler_read_prev<\/td><td>operations\/second<\/td><td>The number of internal READ_PREV statements.<\/td><\/tr><tr><td>mysql.performance.handler_read_rnd<\/td><td>operations\/second<\/td><td>The number of internal READ_RND statements.<\/td><\/tr><tr><td>mysql.performance.handler_read_rnd_next<\/td><td>operations\/second<\/td><td>The number of internal READ_RND_NEXT statements.<\/td><\/tr><tr><td>mysql.performance.handler_rollback<\/td><td>operations\/second<\/td><td>The number of internal ROLLBACK statements.<\/td><\/tr><tr><td>mysql.performance.handler_update<\/td><td>operations\/second<\/td><td>The number of internal UPDATE statements.<\/td><\/tr><tr><td>mysql.performance.handler_write<\/td><td>operations\/second<\/td><td>The number of internal WRITE statements.<\/td><\/tr><tr><td>mysql.performance.kernel_time<\/td><td>percent<\/td><td>Percentage of CPU time spent in kernel space by MySQL.<\/td><\/tr><tr><td>mysql.performance.key_cache_utilization<\/td><td>fractions<\/td><td>The key cache utilization ratio.<\/td><\/tr><tr><td>mysql.performance.open_files<\/td><td>files<\/td><td>The number of open files.<\/td><\/tr><tr><td>mysql.performance.open_tables<\/td><td>tables<\/td><td>The number of of tables that are open.<\/td><\/tr><tr><td>mysql.performance.opened_tables<\/td><td>tables\/second<\/td><td>The number of tables that have been opened. If Opened_tables is big, your table_open_cache value is probably too small.<\/td><\/tr><tr><td>mysql.performance.qcache.utilization<\/td><td>fractions<\/td><td>Fraction of the query cache memory currently being used.<\/td><\/tr><tr><td>mysql.performance.qcache_free_blocks<\/td><td>blocks<\/td><td>The number of free memory blocks in the query cache.<\/td><\/tr><tr><td>mysql.performance.qcache_free_memory<\/td><td>bytes<\/td><td>The amount of free memory for the query cache.<\/td><\/tr><tr><td>mysql.performance.qcache_hits<\/td><td>hits\/second<\/td><td>The rate of query cache hits.<\/td><\/tr><tr><td>mysql.performance.qcache_inserts<\/td><td>queries\/second<\/td><td>The number of queries added to the query cache.<\/td><\/tr><tr><td>mysql.performance.qcache_lowmem_prunes<\/td><td>queries\/second<\/td><td>The number of queries that were deleted from the query cache because of low memory.<\/td><\/tr><tr><td>mysql.performance.qcache_not_cached<\/td><td>queries\/second<\/td><td>The number of noncached queries (not cacheable, or not cached due to the query_cache_type setting).<\/td><\/tr><tr><td>mysql.performance.qcache_queries_in_cache<\/td><td>queries<\/td><td>The number of queries registered in the query cache.<\/td><\/tr><tr><td>mysql.performance.qcache_size<\/td><td>bytes<\/td><td>The amount of memory allocated for caching query results.<\/td><\/tr><tr><td>mysql.performance.qcache_total_blocks<\/td><td>blocks<\/td><td>The total number of blocks in the query cache.<\/td><\/tr><tr><td>mysql.performance.queries<\/td><td>queries\/second<\/td><td>The rate of queries.<\/td><\/tr><tr><td>mysql.performance.query_run_time.avg<\/td><td>microseconds<\/td><td>Avg query response time per schema.<\/td><\/tr><tr><td>mysql.performance.questions<\/td><td>queries\/second<\/td><td>The rate of statements executed by the server.<\/td><\/tr><tr><td>mysql.performance.select_full_join<\/td><td>operations\/second<\/td><td>The number of joins that perform table scans because they do not use indexes. If this value is not 0, you should carefully check the indexes of your tables.<\/td><\/tr><tr><td>mysql.performance.select_full_range_join<\/td><td>operations\/second<\/td><td>The number of joins that used a range search on a reference table.<\/td><\/tr><tr><td>mysql.performance.select_range<\/td><td>operations\/second<\/td><td>The number of joins that used ranges on the first table. This is normally not a critical issue even if the value is quite large.<\/td><\/tr><tr><td>mysql.performance.select_range_check<\/td><td>operations\/second<\/td><td>The number of joins without keys that check for key usage after each row. If this is not 0, you should carefully check the indexes of your tables.<\/td><\/tr><tr><td>mysql.performance.select_scan<\/td><td>operations\/second<\/td><td>The number of joins that did a full scan of the first table.<\/td><\/tr><tr><td>mysql.performance.slow_queries<\/td><td>queries\/second<\/td><td>The rate of slow queries.<\/td><\/tr><tr><td>mysql.performance.sort_merge_passes<\/td><td>operations\/second<\/td><td>The number of merge passes that the sort algorithm has had to do. If this value is large, you should consider increasing the value of the sort_buffer_size system variable.<\/td><\/tr><tr><td>mysql.performance.sort_range<\/td><td>operations\/second<\/td><td>The number of sorts that were done using ranges.<\/td><\/tr><tr><td>mysql.performance.sort_rows<\/td><td>operations\/second<\/td><td>The number of sorted rows.<\/td><\/tr><tr><td>mysql.performance.sort_scan<\/td><td>operations\/second<\/td><td>The number of sorts that were done by scanning the table.<\/td><\/tr><tr><td>mysql.performance.table_cache_hits<\/td><td>hits\/second<\/td><td>The number of hits for open tables cache lookups.<\/td><\/tr><tr><td>mysql.performance.table_cache_misses<\/td><td>misses\/second<\/td><td>The number of misses for open tables cache lookups.<\/td><\/tr><tr><td>mysql.performance.table_locks_immediate<\/td><td><\/td><td>The number of times that a request for a table lock could be granted immediately.<\/td><\/tr><tr><td>mysql.performance.table_locks_waited<\/td><td><\/td><td>The total number of times that a request for a table lock could not be granted immediately and a wait was needed.<\/td><\/tr><tr><td>mysql.performance.table_open_cache<\/td><td><\/td><td>The number of open tables for all threads. Increasing this value increases the number of file descriptors that mysqld requires.<\/td><\/tr><tr><td>mysql.performance.thread_cache_size<\/td><td>bytes<\/td><td>How many threads the server should cache for reuse. When a client disconnects, the client&#8217;s threads are put in the cache if there are fewer than thread_cache_size threads there.<\/td><\/tr><tr><td>mysql.performance.threads_cached<\/td><td>threads<\/td><td>The number of threads in the thread cache.<\/td><\/tr><tr><td>mysql.performance.threads_connected<\/td><td>connections<\/td><td>The number of currently open connections.<\/td><\/tr><tr><td>mysql.performance.threads_created<\/td><td>threads<\/td><td>The number of threads created to handle connections. If Threads_created is big, you may want to increase the thread_cache_size value.<\/td><\/tr><tr><td>mysql.performance.threads_running<\/td><td>threads<\/td><td>The number of threads that are not sleeping.<\/td><\/tr><tr><td>mysql.performance.user_time<\/td><td>percent<\/td><td>Percentage of CPU time spent in user space by MySQL.<\/td><\/tr><tr><td>mysql.queries.count<\/td><td>queries<\/td><td>The total count of executed queries per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.errors<\/td><td>errors<\/td><td>The total count of queries run with an error per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.lock_time<\/td><td>nanoseconds<\/td><td>The total time spent waiting on locks per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.no_good_index_used<\/td><td>queries<\/td><td>The total count of queries which used a sub-optimal index per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.no_index_used<\/td><td>queries<\/td><td>The total count of queries which do not use an index per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.rows_affected<\/td><td>rows<\/td><td>The number of rows mutated per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.rows_examined<\/td><td>rows<\/td><td>The number of rows examined per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.rows_sent<\/td><td>rows<\/td><td>The number of rows sent per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.select_full_join<\/td><td><\/td><td>The total count of full table scans on a joined table per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.select_scan<\/td><td><\/td><td>The total count of full table scans on the first table per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.queries.time<\/td><td>nanoseconds<\/td><td>The total query execution time per query per schema. This metric is only available as part of the Deep Database Monitoring ALPHA.<\/td><\/tr><tr><td>mysql.replication.replicas_connected<\/td><td><\/td><td>Number of replicas connected to a replication source.<\/td><\/tr><tr><td>mysql.replication.seconds_behind_master<\/td><td>seconds<\/td><td>The lag in seconds between the master and the slave.<\/td><\/tr><tr><td>mysql.replication.slave_running<\/td><td><\/td><td>Deprecated. Use service check mysql.replication.replica_running instead. A boolean showing if this server is a replication slave \/ master that is running.<\/td><\/tr><tr><td>mysql.replication.slaves_connected<\/td><td><\/td><td>Deprecated. Use mysql.replication.replicas_connected instead. Number of slaves connected to a replication master.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 &#8211; Install Datadog Agent in <a rel=\"noreferrer noopener\" href=\"https:\/\/www.devopsschool.com\/blog\/how-to-install-datadog-agent-in-centos\/\" data-type=\"URL\" data-id=\"https:\/\/www.devopsschool.com\/blog\/how-to-install-datadog-agent-in-centos\/\" target=\"_blank\">Centos<\/a> OR <a rel=\"noreferrer noopener\" href=\"https:\/\/www.devopsschool.com\/blog\/how-to-install-datadog-agent-in-ubuntu\/\" data-type=\"URL\" data-id=\"https:\/\/www.devopsschool.com\/blog\/how-to-install-datadog-agent-in-ubuntu\/\" target=\"_blank\">Ubuntu<\/a> OR <a rel=\"noreferrer noopener\" href=\"https:\/\/www.devopsschool.com\/blog\/datadog-agent-setup-in-windows-step-by-step-guide\/\" data-type=\"URL\" data-id=\"https:\/\/www.devopsschool.com\/blog\/datadog-agent-setup-in-windows-step-by-step-guide\/\" target=\"_blank\">Windows<\/a><\/h2>\n\n\n\n<p>The MySQL check is included in the Datadog Agent package. No additional installation is needed on your MySQL server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 &#8211; Install and Configure Mysql Server in Centos<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a data-type=\"URL\" data-id=\"https:\/\/www.devopsschool.com\/tutorial\/mysql\/how-to-install-mysql-on-centos-7.html\" href=\"https:\/\/www.devopsschool.com\/tutorial\/mysql\/how-to-install-mysql-on-centos-7.html\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install MySQL on CentOS 7<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-install-mysql-server-and-client-on-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.devopsschool.com\/blog\/how-to-install-mysql-server-and-client-on-ubuntu\/<\/a><\/li>\n\n\n\n<li><a rel=\"noreferrer noopener\" href=\"https:\/\/www.devopsschool.com\/blog\/installing-xampp-7-4-xxx-on-ubuntu\/\" data-type=\"URL\" data-id=\"https:\/\/www.devopsschool.com\/blog\/installing-xampp-7-4-xxx-on-ubuntu\/\" target=\"_blank\">Alternate &#8211; You may use XAMPP as well. How to install and Configure XAMPP on Ubuntu?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-configure-xampp-and-wordpress-in-linux\/\" data-type=\"URL\" data-id=\"https:\/\/www.devopsschool.com\/blog\/how-to-configure-xampp-and-wordpress-in-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Install &amp; configure Xampp with mysql in Linux?<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 &#8211; Prepare MySQL. On each MySQL server, create a database user for the Datadog Agent:<\/h2>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"526\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/04\/install-config-datadog-integration-with-mysql-1.jpg\" alt=\"\" class=\"wp-image-20860\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/04\/install-config-datadog-integration-with-mysql-1.jpg 806w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/04\/install-config-datadog-integration-with-mysql-1-300x196.jpg 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2021\/04\/install-config-datadog-integration-with-mysql-1-768x501.jpg 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># How to login mysql server?<\/span>\n$ mysql -h localhost -u root -p\n\nmysql&gt; CREATE USER <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'localhost'<\/span> IDENTIFIED BY <span class=\"hljs-string\">'&lt;UNIQUEPASSWORD&gt;'<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\n<span class=\"hljs-keyword\">For<\/span> mySQL <span class=\"hljs-number\">8.0<\/span>+ create the datadog user with the native password hashing method:\n\nmysql&gt; CREATE USER <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'localhost'<\/span> IDENTIFIED WITH mysql_native_password by <span class=\"hljs-string\">'&lt;UNIQUEPASSWORD&gt;'<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\nNote: @<span class=\"hljs-string\">'localhost'<\/span> is only <span class=\"hljs-keyword\">for<\/span> local connections - <span class=\"hljs-keyword\">use<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">hostname<\/span>\/<span class=\"hljs-title\">IP<\/span> <span class=\"hljs-title\">of<\/span> <span class=\"hljs-title\">your<\/span> <span class=\"hljs-title\">Agent<\/span> <span class=\"hljs-title\">for<\/span> <span class=\"hljs-title\">remote<\/span> <span class=\"hljs-title\">connections<\/span>. <span class=\"hljs-title\">For<\/span> <span class=\"hljs-title\">more<\/span> <span class=\"hljs-title\">information<\/span>, <span class=\"hljs-title\">see<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">MySQL<\/span> <span class=\"hljs-title\">documentation<\/span>.\n\n<span class=\"hljs-title\">Verify<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">user<\/span> <span class=\"hljs-title\">was<\/span> <span class=\"hljs-title\">created<\/span> <span class=\"hljs-title\">successfully<\/span> <span class=\"hljs-title\">using<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">following<\/span> <span class=\"hljs-title\">commands<\/span> - <span class=\"hljs-title\">replace<\/span> &lt;<span class=\"hljs-title\">UNIQUEPASSWORD<\/span>&gt; <span class=\"hljs-title\">with<\/span> <span class=\"hljs-title\">the<\/span> <span class=\"hljs-title\">password<\/span> <span class=\"hljs-title\">you<\/span> <span class=\"hljs-title\">created<\/span> <span class=\"hljs-title\">above<\/span>:\n\n<span class=\"hljs-title\">mysql<\/span> -<span class=\"hljs-title\">u<\/span> <span class=\"hljs-title\">datadog<\/span> --<span class=\"hljs-title\">password<\/span>=&lt;<span class=\"hljs-title\">UNIQUEPASSWORD<\/span>&gt; -<span class=\"hljs-title\">e<\/span> \"<span class=\"hljs-title\">show<\/span> <span class=\"hljs-title\">status<\/span>\" | \\\n<span class=\"hljs-title\">grep<\/span> <span class=\"hljs-title\">Uptime<\/span> &amp;&amp; <span class=\"hljs-title\">echo<\/span> -<span class=\"hljs-title\">e<\/span> \"\\033&#91;0;<span class=\"hljs-number\">32<\/span>mMySQL user - OK\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>m<span class=\"hljs-string\">\" || \\\necho -e \"<\/span>\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>;<span class=\"hljs-number\">31<\/span>mCannot connect to MySQL\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>m<span class=\"hljs-string\">\"\n\nmysql -u datadog --password=&lt;UNIQUEPASSWORD&gt; -e \"<\/span>show slave status<span class=\"hljs-string\">\" &amp;&amp; \\\necho -e \"<\/span>\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>;<span class=\"hljs-number\">32<\/span>mMySQL grant - OK\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>m<span class=\"hljs-string\">\" || \\\necho -e \"<\/span>\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>;<span class=\"hljs-number\">31<\/span>mMissing REPLICATION CLIENT grant\\<span class=\"hljs-number\">033<\/span>&#91;<span class=\"hljs-number\">0<\/span>m<span class=\"hljs-string\">\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Step 4 &#8211; The Agent needs a few privileges to collect metrics. Grant the user the following limited privileges ONLY:<\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">mysql&gt; GRANT REPLICATION CLIENT ON *.* TO <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'localhost'<\/span> WITH MAX_USER_CONNECTIONS <span class=\"hljs-number\">5<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected, <span class=\"hljs-number\">1<\/span> warning (<span class=\"hljs-number\">0.00<\/span> sec)\n\nmysql&gt; GRANT PROCESS ON *.* TO <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'localhost'<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\n<span class=\"hljs-keyword\">For<\/span> MySQL <span class=\"hljs-number\">8.0<\/span>+ set max_user_connections with:\n\nmysql&gt; ALTER USER <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'localhost'<\/span> WITH MAX_USER_CONNECTIONS <span class=\"hljs-number\">5<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\n<span class=\"hljs-keyword\">If<\/span> enabled, metrics can be collected from the performance_schema database by granting an additional privilege:\n\nmysql&gt; show databases like <span class=\"hljs-string\">'performance_schema'<\/span>;\n+-------------------------------+\n| Database (performance_schema) |\n+-------------------------------+\n| performance_schema            |\n+-------------------------------+\n<span class=\"hljs-number\">1<\/span> row in set (<span class=\"hljs-number\">0.00<\/span> sec)\n\nmysql&gt; GRANT SELECT ON performance_schema.* TO <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'localhost'<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Step 5 &#8211; Configure Datadog agent to start collection mysql metrix.<\/h2>\n\n\n\n<p>Edit the mysql.d\/conf.yaml file, in the conf.d\/ folder at the root of your Agent&#8217;s configuration directory to start collecting your MySQL metrics and logs. See the sample mysql.d\/conf.yaml for all available configuration options.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">$ cd \/etc\/datadog-agent\/conf.d\/mysql.d\/\n$ sudo cp conf.yaml.example conf.yaml\n$ sudo vi conf.yaml (CHECK IMAGE BELOW)\n$ sudo service datadog-agent restart &#91;UBUNTU]\n$ sudo systemctl restart datadog-agent &#91;Centos]\n\n\nMetric collection\nAdd this configuration block to your mysql.d\/conf.yaml to collect your MySQL metrics:\n\ninit_config:\n\ninstances:\n  - server: <span class=\"hljs-number\">127.0<\/span><span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.1<\/span>\n    user: datadog\n    pass: <span class=\"hljs-string\">\"&lt;YOUR_CHOSEN_PASSWORD&gt;\"<\/span> <span class=\"hljs-comment\"># from the CREATE USER step earlier<\/span>\n    port: <span class=\"hljs-string\">\"&lt;YOUR_MYSQL_PORT&gt;\"<\/span> <span class=\"hljs-comment\"># e.g. 3306<\/span>\n    options:\n      replication: <span class=\"hljs-keyword\">false<\/span>\n      galera_cluster: <span class=\"hljs-keyword\">true<\/span>\n      extra_status_metrics: <span class=\"hljs-keyword\">true<\/span>\n      extra_innodb_metrics: <span class=\"hljs-keyword\">true<\/span>\n      extra_performance_metrics: <span class=\"hljs-keyword\">true<\/span>\n      schema_size_metrics: <span class=\"hljs-keyword\">false<\/span>\n      disable_innodb_metrics: <span class=\"hljs-keyword\">false<\/span>\nNote: Wrap your password in single quotes in <span class=\"hljs-keyword\">case<\/span> a special character is present.<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Step 5 &#8211;  Validate mysql metrices<\/h2>\n\n\n\n<p>$ systemctl restart datadog-agent<\/p>\n\n\n\n<p>$ datadog-agent status<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"677\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-37-1024x677.png\" alt=\"\" class=\"wp-image-30349\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-37-1024x677.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-37-300x198.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-37-768x508.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-37.png 1195w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"493\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-38-1024x493.png\" alt=\"\" class=\"wp-image-30350\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-38-1024x493.png 1024w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-38-300x144.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-38-768x370.png 768w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-38-1536x739.png 1536w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2022\/06\/image-38.png 1714w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">MariaDB changes<\/h2>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">mysql&gt; CREATE USER <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'%'<\/span> IDENTIFIED BY <span class=\"hljs-string\">'Raju$123456'<\/span>;\n\nmysql&gt; GRANT REPLICATION CLIENT ON *.* TO <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'%'<\/span>\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\nmysql&gt; ALTER USER <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'%'<\/span> WITH MAX_USER_CONNECTIONS <span class=\"hljs-number\">5<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\nmysql&gt; GRANT PROCESS ON *.* TO <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'%'<\/span>;\nQuery OK, <span class=\"hljs-number\">0<\/span> rows affected (<span class=\"hljs-number\">0.00<\/span> sec)\n\nmysql&gt; show databases like <span class=\"hljs-string\">'performance_schema'<\/span>;\n+-------------------------------+\n| Database (performance_schema) |\n+-------------------------------+\n| performance_schema            |\n+-------------------------------+\n<span class=\"hljs-number\">1<\/span> row in set (<span class=\"hljs-number\">0.00<\/span> sec)\n\nmysql&gt; GRANT SELECT ON performance_schema.* TO <span class=\"hljs-string\">'datadog'<\/span>@<span class=\"hljs-string\">'%'<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_43018\"><iframe loading=\"lazy\"  id=\"_ytid_41550\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_43018\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>How to setup Datadog Agent integration with mysql to collect many metrics from MySQL databases? The Datadog Agent can collect many metrics from MySQL databases, including (but not limited to):&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-20849","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/20849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=20849"}],"version-history":[{"count":15,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/20849\/revisions"}],"predecessor-version":[{"id":39657,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/20849\/revisions\/39657"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=20849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=20849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=20849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}