InfoHeap
Tech tutorials, tips, tools and more
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Mysql tutorials

  • Enable query log without restarting mysql on Linux
  • How to find mysql query rate on Linux
  • Mysql - display row count and size of tables
  • Mysql - get size of all databases
  • Mysql - get total queries since beginning
  • Mysql - how to copy a table
  • Mysql - how to enable query log
  • Mysql 5.7 root password after installation
  • Mysql difference between CURDATE() and NOW()
  • Mysql find current timezone offset
  • Mysql find slave lag
  • Mysql how to dump schema of all databases
  • Wordpress Mysql Queries
  • mysql - how to enable query logs
  • mysql find recently created-tables
 
  • Home
  • > Tutorials
  • > Mysql

Enable query log without restarting mysql on Linux

on Jun 16, 2016

Steps to enable mysql query log on mysql server without restarting mysql process on Ubuntu and other Linux flavours.

  1. Set general_log_file on SQL prompt:
    SET GLOBAL general_log_file = '/var/log/mysql/query.log';
    
  2. set general_log to value ‘ON’
    SET GLOBAL general_log = 'ON';
    
  3. Check query log. You may have to use sudo in case you dont have read access to log file.

    $ tail -f /var/log/mysql/query.log
    
  4. In case you want to disable query log
    SET GLOBAL general_log = 'OFF';
    

Note that this approach is not mysql restart safe. To permanently enable query log, please visit Mysql – how to enable query log.

Suggested posts:

  1. WordPress mysql query to get all posts with a specific custom field
  2. Mysql – how to enable query log
  3. mysql – how to enable query logs
  4. How to find mysql query rate on Linux
  5. WordPress mysql query to get all custom keys and values for a post
  6. Linux – how to enable password login on ssh server
  7. How to check the performance of a plugin using mysql query log
  8. Mysql query to find all yoast meta description
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Linux, Linux/Unix Command Line, Mysql, Ubuntu Linux

Follow InfoHeap

facebook
twitter
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries

Copyright © 2021 InfoHeap.

Powered by WordPress