zoukankan      html  css  js  c++  java
  • 转 怎么看mysql 的历史登陆情况

    https://serverfault.com/questions/496216/viewing-usage-history-in-mysql

    Viewing usage history in MySQL

    Q:

    We have Ubuntu 11.10 server that is running a LAMP stack, it was set up before I got here and no one knows what its for. I have to migrate it, or just shut it down but I need to know what its doing first.

    Digging through it, there are no sites hosted off of it however there several databases created in MySQL.

    So it may be connected to one of our sites but none of the devs here know.

    What I need to do is view connection history on the MySQL databases do that I can find what, if anything, is connecting to them.

    I am monitoring the processlist and not seeing any active connections.

    A:

    Mysql login logs can be enabled by starting mysql server with the option --log="log-file" option.

    /usr/bin/safe_mysqld --log="/var/lib/mysql/mysql.log" &

    Mysql log will be logged inside the file /var/lib/mysql/mysql.log. tail this file to see the logs. To see only the login (connect log) use the following command

    grep Connect /var/lib/mysql/mysql.log

    炊烟起了;夕阳下了;细雨来了 多调试,交互式编程体验 记录,独立思考,对比 感谢转载作者 修车 国产化 read and connect 匍匐前进, 讲故事
  • 相关阅读:
    结对作业(测试版)
    回答自己的提问
    阅读一个程序员的生命周期有感
    阅读13到17章提出问题
    读8 9 10章提出问题
    5.2 5.3测试与封装
    5.1 四则运算单元测试j
    阅读5.5章6章7章提出疑问
    做汉堡
    阅读第1到第5章过程的疑问
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/14398863.html
Copyright © 2011-2022 走看看