Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My mysql server crashes on ubuntu server. I need to retrieve the logs. When doing the following: mysql> show variables like '%log%'; I get:

+-----------------------------------------+---------------------------------------+
| Variable_name                           | Value                                 |
+-----------------------------------------+---------------------------------------+
| back_log                                | 50                                    |
| binlog_cache_size                       | 32768                                 |
| binlog_direct_non_transactional_updates | OFF                                   |
| binlog_format                           | STATEMENT                             |
| binlog_stmt_cache_size                  | 32768                                 |
| expire_logs_days                        | 10                                    |
| general_log                             | ON                                    |
| general_log_file                        | /var/log/mysql/mysql.log              |
| innodb_flush_log_at_trx_commit          | 1                                     |
| innodb_locks_unsafe_for_binlog          | OFF                                   |
| innodb_log_buffer_size                  | 8388608                               |
| innodb_log_file_size                    | 5242880                               |
| innodb_log_files_in_group               | 2                                     |
| innodb_log_group_home_dir               | ./                                    |
| innodb_mirrored_log_groups              | 1                                     |
| log                                     | ON                                    |
| log_bin                                 | OFF                                   |
| log_bin_trust_function_creators         | OFF                                   |
| log_error                               |                                       |
| log_output                              | FILE                                  |
| log_queries_not_using_indexes           | OFF                                   |
| log_slave_updates                       | OFF                                   |
| log_slow_queries                        | OFF                                   |
| log_warnings                            | 1                                     |
| max_binlog_cache_size                   | 18446744073709547520                  |
| max_binlog_size                         | 104857600                             |
| max_binlog_stmt_cache_size              | 18446744073709547520                  |
| max_relay_log_size                      | 0                                     |
| relay_log                               |                                       |
| relay_log_index                         |                                       |
| relay_log_info_file                     | relay-log.info                        |
| relay_log_purge                         | ON                                    |
| relay_log_recovery                      | OFF                                   |
| relay_log_space_limit                   | 0                                     |
| slow_query_log                          | OFF                                   |
| slow_query_log_file                     | /var/lib/mysql/echidna-music-slow.log |
| sql_log_bin                             | ON                                    |
| sql_log_off                             | OFF                                   |
| sync_binlog                             | 0                                     |
| sync_relay_log                          | 0                                     |
| sync_relay_log_info                     | 0                                     |
+-----------------------------------------+---------------------------------------+
41 rows in set (0.00 sec)

As far as I understand there is no file defined to log the errors, right?

Even though I have added the following to the my.cnf: [mysqld_safe] log-error = /var/log/mysql/err.log

How can I achieve error logging?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Try moving the 'log-error' definition that you already have under the [mysqld_safe] section to the [mysqld] section

So:

[mysqld]
log-error = /path/to/log/file
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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