---
title: "监控mysql数据"
author: "bayaci"
date: "2012-02-09T13:38:00Z"
tags: []
slug: "mysql"
draft: false
lastmod: "2012-02-21T23:26:24Z"
id: 1416054
url: "https://peter9.iteye.com/blog/1416054"
---

\[mysqld]  
long\_query\_time=1  
log-slow-queries=/var/log/mysql/log-slow-queries.log

You must create the file manually and change owners this way:

mkdir /var/log/mysql  
touch /var/log/mysql/log-slow-queries.log  
chown mysql.mysql -R /var/log/mysql