mysql开启执行的sql的日志

Mysql · Fecmall · 于 5年前 发布 · 2063 次阅读

Edit your /etc/mysql/my.cnfand add the following at the end of the file :

    [mysqld]
    general_log_file = /var/log/mysql/mysql.log
    general_log = 1

Connect through mysql (mysql -u -p) and run :

SET GLOBAL general_log = 1;

Restart mysql :

sudo service mysql restart

查看是否开启成功

show variables like 'general_log%';
共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics