• MySQL数据表导出某条记录


    请按照步骤导出,否则可能会报错:

    ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

    第一步:首先进入数据库

    mysql> show variables like '%secure%';
    +--------------------------+-----------------------+
    | Variable_name            | Value                 |
    +--------------------------+-----------------------+
    | require_secure_transport | OFF                   |
    | secure_auth              | ON                    |
    | secure_file_priv         | /var/lib/mysql-files/ |
    +--------------------------+-----------------------+
    3 rows in set (0.00 sec)

    secure_file_priv为导出路径,必须为这个,后边加文件名;

    第二步:导出

    mysql> select idfa from firstapp_report where day_time between '2018-12-13 00:00:00.028986' and '2018-12-17 23:59:50.512468' into outfile '/var/lib/mysql-files/result.txt' lines terminated by '
    ';;
    Query OK, 86329 rows affected (0.09 sec)
    into outfile “c:/data_out.txt” (输出的文件路径)
    lines terminated by “
    ” (每一行都换行)

    第三步:进入导出的文件路径

    root@vmware01:/var/lib/mysql-files# ls
    result.txt

     # 查询某天的数据

    select count(id) from firstapp_report where callback_result_text='success' and offer_id=25 and date_format(day_time,"%Y-%m-%d")="2018-12-18";
  • 相关阅读:
    前端开发者也可以酷酷地开发桌面程序
    V部落,V人事
    jq 正方体旋转
    jq 实现旋转木马
    jquery 获取元素(父节点,子节点,兄弟节点)
    Vue.js面试题整理
    Java面试必备技能
    在前后端分离的SpringBoot项目中集成Shiro权限框架
    正则表达式大全
    Docker容器日志查看与清理
  • 原文地址:https://www.cnblogs.com/52-qq/p/10147835.html
Copyright © 2020-2023  润新知