码迷,mamicode.com
首页 > 数据库 > 详细

mysql跟踪执行的sql语句

时间:2018-07-12 20:10:15      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:--help   amp   lib   option   mysq   kill   my.cnf   技术分享   png   

修改my.cnf配置文件

/usr/local/mysql/bin/mysql --verbose --help | grep -A 1 ‘Default options‘
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf

修改/etc/my.cnf,找到[mysqld],在下面添加:
general_log_file = "E:/data/mysql.log" slow_query_log = 1

修改完后,记得重启mysql服务哦

不修改配置实现,通过开启服务指定参数实现

[root@iZwz9ga7ceehy3fbxvmmtbZ ~]# ps -ef|grep mysql
技术分享图片
kill -9 1613
nohup /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/home/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=root --log-error=/home/data/mysql/localhost.localdomain.err --general-log=1 --general-log-file=/tmp/mysql.log --pid-file=/home/data/mysql/localhost.localdomain.pid --socket=/tmp/mysql.sock --port=3306 &

mysql跟踪执行的sql语句

标签:--help   amp   lib   option   mysq   kill   my.cnf   技术分享   png   

原文地址:https://www.cnblogs.com/hnhycnlc888/p/9300898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!