step1: 進(jìn)入終端進(jìn)入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: 進(jìn)入終端進(jìn)入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
如您對本文有疑問或者有任何想說的,請點(diǎn)擊進(jìn)行留言回復(fù),萬千網(wǎng)友為您解惑!
來源:本文內(nèi)容搜集或轉(zhuǎn)自各大網(wǎng)絡(luò)平臺(tái),并已注明來源、出處,如果轉(zhuǎn)載侵犯您的版權(quán)或非授權(quán)發(fā)布,請聯(lián)系小編,我們會(huì)及時(shí)審核處理。
聲明:江蘇教育黃頁對文中觀點(diǎn)保持中立,對所包含內(nèi)容的準(zhǔn)確性、可靠性或者完整性不提供任何明示或暗示的保證,不對文章觀點(diǎn)負(fù)責(zé),僅作分享之用,文章版權(quán)及插圖屬于原作者。
Copyright?2013-2024 JSedu114 All Rights Reserved. 江蘇教育信息綜合發(fā)布查詢平臺(tái)保留所有權(quán)利
蘇公網(wǎng)安備32010402000125
蘇ICP備14051488號(hào)-3技術(shù)支持:南京博盛藍(lán)睿網(wǎng)絡(luò)科技有限公司
南京思必達(dá)教育科技有限公司版權(quán)所有 百度統(tǒng)計(jì)