Archive for January, 2009
To change or remove mysql passwd
first login to mysql, then
#mysql -u root -p
to change root pwd
sql> USE mysql;
sql> UPDATE user SET password=PASSWORD(‘yournewpass’) WHERE user=’root’ ;
sql> FLUSH privileges;
to remove pwd
sql> USE mysql;
sql> UPDATE user SET password=PASSWORD(”) WHERE user=’root’ ;
sql> FLUSH privileges;
Add comment January 31, 2009
Steps to do when load average is high
when load average is high
free -m
netstat -plan | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n | tail ; date
/etc/init.d/mysql status
/etc/init.d/httpd status
mysqlcheck -u root -p databasename —–>to check database
To find pid of httpd
/var/run same as local server.
cat /var/run/httpd.pid —->in local server
ps -efw | grep httpd | head -1
To view httpd log message:
tail /var/log/httpd/error_log —–>in local server
tail /var/log/httpd/access_log —–>in local server
tail /usr/local/apache/log/error_log —->in server with cpanel only for apache
tail /usr/local/apache/log/access_log —->in server with cpanel only for apache
Check Zombie process
ps -elf | grep Z
ps -el | grep Z
ps aux | awk ‘{print $8″ “$2}’ | grep -w
if necessary
killall -9 httpd
killall -9 mysql —->to kill mysql process
Add comment January 31, 2009