Hello I just installed MySQL on my Fedora from Source, with cmake,make,make install etc. It's working, but where can I find logs of the server? I have looked into /var/log, but there is nothing with mysql unfortunately.


# For advice on how to change settings please see
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M

# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin

# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....

# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

  • Could you please specify version of MySQL and Fedora and if you configured some compilation parameters of MySQL?
    – pabouk
    Oct 16 '13 at 17:19

If you have mysqld running you can inspect its open descriptors to see where it logs, for example using proc:

[root@localhost ~]# ls -l `pgrep mysqld | sed 's@.*@/proc/&/fd/@'` | grep log
l-wx------. 1 root root 64 Jul 23 10:47 1 -> /var/log/mysqld.log
l-wx------. 1 root root 64 Jul 23 10:47 2 -> /var/log/mysqld.log
lrwx------. 1 root root 64 Jul 23 10:47 8 -> /var/lib/mysql/ib_logfile0
lrwx------. 1 root root 64 Jul 23 10:47 9 -> /var/lib/mysql/ib_logfile1
[root@localhost ~]# 

In this case is /var/log/mysqld.log

  • When I did this it only list the ib_logfile0 and ib_logfile1, when i try to cat them, they are full of @@@@@@@@@@@@@ :/ Oct 16 '13 at 17:22
  • Looks like your mysql is not logging at all, then. The logfile0..1 are binary logfiles of db data, not human readable logfiles.
    – cyberz
    Oct 16 '13 at 17:24
  • Check your my.cnf, for example on mine I have: log-error=/var/log/mysqld.log under the [mysqld_safe] section.
    – cyberz
    Oct 16 '13 at 17:25
  • My my.cnf if almost empty, my mysql is running, I logged, create databases, tables, 2 users, logged with them, everything looked fine, i paste my "etc/my.cnf" in edit #1 Oct 16 '13 at 17:27
  • Add log-error=/var/log/mysqld.log in the [mysqld_safe] and restart MySQL server, it should log. Also ensure that the /var/log/mysqld.log is writable by the mysql user.
    – cyberz
    Oct 16 '13 at 17:52

There are different types of logs which are determined by the following global MySQL variables:

If you would like to read the error log file, try this command:

sudo tail -f $(mysql -Nse "SELECT @@GLOBAL.log_error")

then hit Control-C when finish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.