LoginSignup
25
27

More than 5 years have passed since last update.

MySQLのクエリログの取得を動的にONOFFする

Posted at
//rootでmysqlにログインして、
$ mysql -u root -p
Enter password:
Welcome to the MySQL 以下略

mysql> -- テーブルに出力するか、ファイルに出力するか。
mysql> set global log_output='TABLE';
Query OK, 0 rows affected (0.00 sec)

mysql> -- ログを取る
mysql> -- (大文字小文字は区別されない)
mysql> set global general_log='ON';
Query OK, 0 rows affected (0.00 sec)

mysql> -- ログ取得を止める
mysql> set global general_log='OFF';
Query OK, 0 rows affected (0.00 sec)
25
27
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
25
27