您好,登錄后才能下訂單哦!
方法一:更改my.cnf配置文件
vi /usr/local/kkmail/config/mysql/my.cnf 將下面兩行注釋取消掉,然后重啟mysql #general_log = 1 #general_log_file = /tmp/kkmail_mysql.log
# 設置general log保存路徑
# 好像只能設置保存到 /tmp 或 /var 文件夾下。
方法二:在mysql命令控制臺操作
# 需要root用戶才有訪問此文件的權限 mysql> show global variables like '%general%'; +------------------+----------------------------------------------------+ | Variable_name | Value | +------------------+----------------------------------------------------+ | general_log | OFF | | general_log_file | /usr/local/kkmail/data/mysql/default/localhost.log | +------------------+----------------------------------------------------+ 2 rows in set (0.00 sec) mysql> set global general_log_file='/tmp/kkmail_mysql.log'; Query OK, 0 rows affected (0.00 sec) mysql> set global general_log=on; Query OK, 0 rows affected (0.05 sec) mysql> show global variables like '%general%'; +------------------+----------------------+ | Variable_name | Value | +------------------+----------------------+ | general_log | ON | | general_log_file | /tmp/kkmail_mysql.log | +------------------+----------------------+ 2 rows in set (0.00 sec) mysql> set global general_log=off; Query OK, 0 rows affected (0.00 sec) mysql> show global variables like '%general%'; +------------------+----------------------+ | Variable_name | Value | +------------------+----------------------+ | general_log | OFF | | general_log_file | /tmp/kkmail_mysql.log | +------------------+----------------------+ 2 rows in set (0.00 sec)
方法三:將日志保存在mysql數據庫general_log表中
mysql> set global log_output='table'; Query OK, 0 rows affected (0.00 sec) mysql> show global variables like '%general%'; +------------------+----------------------+ | Variable_name | Value | +------------------+----------------------+ | general_log | OFF | | general_log_file | /tmp/kkmail_mysql.log | +------------------+----------------------+ 2 rows in set (0.00 sec) mysql> set global general_log=on; Query OK, 0 rows affected (0.00 sec) mysql> show global variables like '%general%'; +------------------+----------------------+ | Variable_name | Value | +------------------+----------------------+ | general_log | ON | | general_log_file | /tmp/kkmail_mysql.log | +------------------+----------------------+ 2 rows in set (0.01 sec) mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select * from general_log;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。