Thank you for visiting the Rackspace Community
The The Community is live! Post new content or topics so our teams can assist.

Please contact your support team if you have a question or need assistance for any Rackspace products, services, or articles.

How can I access to MySql error log?

As the title says, I'm trying to access mysql error log. I've read but doesn't cover error log case.


  • open phpmyadmin/any application that uses mysql/mysql console and run a query

  • Here is a simple way to enable them. In mysql we need to see often 3 logs which are mostly needed during any project development.

    • The Error Log. It contains information about errors that occur while the server is running (also server start and stop)

    • The General Query Log. This is a general record of what mysqld is doing (connect, disconnect, queries)

    • The Slow Query Log. Ιt consists of "slow" SQL statements (as indicated by its name).

    By default no log files are enabled in MYSQL. All errors will be shown in the syslog.(/var/log/syslog)

    To Enable them just follow below steps

    step1: Go to this file(/etc/mysql/conf.d/mysqld_safe_syslog.cnf) and remove or comment those line.

    step2: Go to mysql conf file(/etc/mysql/my.cnf ) and add following lines

    To enable error log add following


    To enable general query log add following

    general_log_file        = /var/log/mysql/mysql.log
    general_log             = 1

    To enable Slow Query Log add following

    log_slow_queries       = /var/log/mysql/mysql-slow.log
    long_query_time = 2

    step3: save the file and restart mysql using following commands

    service mysql restart

    To enable logs at runtime, login to mysql client (mysql -u root -p ) and give:

    SET GLOBAL general_log = 'ON';
    SET GLOBAL slow_query_log = 'ON';

    Finally one thing I would like to mention here is I read this from a blog. Thanks. It works for me.



  • There are many ways by which you can solve the problem of the MySql things and now we are moving to the latest trend which was offered by this website

  • Check mysql error log
    1. To enable error log add following [mysqld_safe] log_error=/var/log/mysql/mysql_error. log [mysqld] log_error=/var/log/mysql/mysql_error. ...
    2. To enable general query log add following general_log_file = /var/log/MySQL/MySQL
    3. To enable Slow Query Log add following log_slow_queries = /var/log/MySQL/MySQL

    Using this you can get the solution of your problem. If anyone is facing problem regarding Netgear, they can take help from Netgear Support, I also get help from here.