• 当前位置: 首 页 > 教育百科 > 学历/技能 > 正文

    mac mysql开启日志

    :2022年10月21日
    CSDN

    step1: 进入终端进入mysql:(mysql -uroot -p)Jason-MacBook-Pro:~ wangying$ mysql -uroot -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 9...

    step1: 进入终端进入mysql:(mysql -uroot -p)

    Jason-MacBook-Pro:~ wangying$ mysql -uroot -p

    Enter password:

    Welcome to the MySQL monitor. Commands end with ; or \g.

    Your MySQL connection id is 9

    Server version: 8.0.19 MySQL Community Server - GPL

    Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

    Oracle is a registered trademark of Oracle Corporation and/or its

    affiliates. Other names may be trademarks of their respective

    owners.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    step2 : 开启mysql日志(set global general_log = on)

    mysql> set global general_log = on

    -> ;

    Query OK, 0 rows affected (0.01 sec)

    step3 : 查看mysql的日志文件所在位置(show variables like'general_log_file')

    mysql> show variables like'general_log_file';

    +------------------+---------------------------------------------+

    | Variable_name | Value |

    +------------------+---------------------------------------------+

    | general_log_file | /usr/local/mysql/data/Jason-MacBook-Pro.log |

    +------------------+---------------------------------------------+

    1 row in set (0.01 sec)

    step4 : 在终端中用tail -f 命令打开该日志文件:(sudo tail -f 上面查到的sqllog日志路径)

    Jason-MacBook-Pro:~ wangying$ sudo tail -f /usr/local/mysql/data/Jason-MacBook-Pro.log

    Password:

    /usr/local/mysql/bin/mysqld, Version: 8.0.19 (MySQL Community Server - GPL). started with:

    Tcp port: 3306 Unix socket: /tmp/mysql.sock

    Time Id Command Argument

    2020-07-16T10:05:24.931239Z 9 Queryshow variables like'general_log_file'

    2020-07-16T10:08:27.838478Z 9 Queryshow databases

    本文地址:https://blog.csdn.net/Jason_WangYing/article/details/107389505

    如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

    [编辑:王振袢 &发表于江苏]
    [我要纠错]

    来源:本文内容搜集或转自各大网络平台,并已注明来源、出处,如果转载侵犯您的版权或非授权发布,请联系小编,我们会及时审核处理。
    声明:江苏教育黄页对文中观点保持中立,对所包含内容的准确性、可靠性或者完整性不提供任何明示或暗示的保证,不对文章观点负责,仅作分享之用,文章版权及插图属于原作者。

    关键词: step1 进入 终端 进入 mysql
    有价值
    0
    无价值
    0
    猜您喜欢
    最热文章

    暂不支持手机端,请登录电脑端访问

    正在加载验证码......

    请先完成验证