2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mysql5.7でSQLログを出す

2
Posted at

設定ファイル編集

vim /etc/my.cnf
my.cnf
# Set General Log
general_log=1                                                                                                                                                   
log_output=FILE
general_log_file=/var/log/mysqld-general_query.log

ログファイルに権限付与

touch /var/log/mysqld-general_query.log
chown mysql.mysql /var/log/mysqld-general_query.log
chmod 640 /var/log/mysqld-general_query.log

*以下のサイトを参考にさせていただきました
http://qiita.com/torshinor/items/178f26277678fadd7cb0

サービス再起動

systemctl restart mysqld  
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?