• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

stats not running

Amin Taheri

Golden Pleskian
Plesk Certified Professional
Hello,

When trying to run stats for a user I get a mysql error - same error occurs if I do not specify to calculate one and try and do them all.

Additionally the users access_log is quite big, and despite log rotate settings for the domain to be set to daily, it hasnt been rotated since May and running logrotate manually didnt do anything.


# admin/sbin/statistics --calculate-one --domain-name=domain.com
statistics: Mysql server has gone away. Trying to reconnect
statistics: Mysql server has gone away. Trying to reconnect
statistics: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
System error 111: Connection refused
statistics: Unable to connect to Plesk Database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
System error 111: Connection refused
statistics: Unable to reconnect to the mysql database

System error 111: Connection refused
statistics: Unable to reconnect to the mysql database

System error 111: Connection refused

I saw this in the log files
# tail -n15 /var/log/mysqld.log
100729 10:39:39 InnoDB: Started; log sequence number 0 630732307
100729 10:39:39 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
100729 10:39:39 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50022, now running 50148. Please use mysql_upgrade to fix this error.
100729 10:39:39 [ERROR] mysql.user has no `Event_priv` column at position 29
100729 10:39:39 [ERROR] Cannot open mysql.event
100729 10:39:39 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
100729 10:39:39 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.48' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
100802 11:02:36 [Note] /usr/libexec/mysqld: Normal shutdown

100802 11:02:38 InnoDB: Starting shutdown...
100802 11:02:39 InnoDB: Shutdown completed; log sequence number 0 636646999
100802 11:02:39 [Note] /usr/libexec/mysqld: Shutdown complete

100802 11:02:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

So I ran the mysql upgrader manually
mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow `

And that seemed to solve the problem - it appears now that stats are able to run with out causing the mysql error.

Hope this helps some one.
 
Back
Top