A long time to display when starting mysqld
Timeout error occurred trying to start MySQL Daemon.
Display when terminal enters MySQL
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
Later found to be/var/log/httpd/the next log file will be full of disk space caused by the deletion after the restart of the server is good.
Apache Log management and large log cleanup methods
There are three ways to round the Web server log:
The first approach is to take advantage of the Linux system's own log file rotation mechanism: logrotate;
The second method is to take advantage of Apache's own log round-robin program Rotatelogs;
The third is to use the FAQ in Apache to recommend the development of a more mature log round tool cronolog.
What I bring to you here is to use Apache's own log-round program rotatelogs, and to periodically delete log files with shell scripts, keeping only the files for nearly 3 days, so that the log files are full of
disk space.
Modify Master Profile httpd.conf
to find the following and modify it to:
errorlog/var/log/httpd/error_log
Customlog "|/usr/local/apache2/bin/rotatelogs /var/log/httpd/access_log 86400 400M" Combined
# 86400 ---Log scrolling time is one day
# 400 ---Log file up to 400M scroll
# Combined---in composite format
then establish a shell script to purge the log files, file name Clean_log
#!/bin/bash
logdir=/var/log/httpd
CD ${logdir}
Declare-i filesum= ' ls access_log.* | Wc-l '
declare-i delnum= $filesum-3
If ["${delnum}"-ge 1];then
rm-rf ' ls-tr access_log.* | Head-${delnum} ' Br>fi
chmod 755 Clean_log
This preserves the last 3 days of log files.
Setting up an Automation task
/usr/local/crontab/clean_log
OK, it's that simple. So you don't have to worry about the growing log files!
Linux start MySQL prompt: Timeout error occurred trying to start MySQL Daemon