Reputation: 725
I have installed Visitor Module Drupal 7. I have viewed the reports using www.domain.com/visitors. All the reports are working well. But when i view the user activity report it shows below error.
PDOException: SQLSTATE[HY000]: General error: 3 Error writing file '/tmp/MYHKgYpv' (Errcode: 28): SELECT u.name AS name, u.uid AS uid, COUNT(DISTINCT v.visitors_id) AS hits, COUNT(DISTINCT n.nid) AS nodes, COUNT(DISTINCT c.cid) AS comments FROM {users} u LEFT OUTER JOIN {visitors} v ON u.uid=v.visitors_uid LEFT OUTER JOIN {node} n ON u.uid=n.uid LEFT OUTER JOIN {comment} c ON u.uid=c.uid WHERE (visitors_date_time BETWEEN :db_condition_placeholder_0 AND :db_condition_placeholder_1) GROUP BY u.name, u.uid, v.visitors_uid, n.uid, c.uid ORDER BY hits DESC LIMIT 10 OFFSET 0; Array ( [:db_condition_placeholder_0] => 1451606400 [:db_condition_placeholder_1] => 1452556799 ) in PagerDefault->execute() (line 79 of /home/legalmon/public_html/includes/pager.inc).
How can i fix this issue?
Upvotes: 4
Views: 9383
Reputation: 52
You should continuously check your /tmp folder size while triggering "USER REPORT Query".
If /tmp directory is 100% utilized you would experience this error.
Solution is to mount some GB's to /tmp directory or set new location of MySQL tmp.
To setting up New location:
Create a directory anywhere you have enough space(can be the "/" root directory)
# mkdir /home/mysqltmp
Give write permissions
# chmod 1777 /home/mysqltmp
Open MY.CNF File
# /etc/my.cnf
Add below line under the [mysqld] section and save the file
# tmpdir=/home/mysqltmp
Restart MySQL
# /etc/init.d/mysql restart
Check new location
# mysqladmin var | grep tmpdir
This should show following return.
| slave_load_tmpdir | /home/mysqltmp
| tmpdir | /home/mysqltmp
Done !!
Try refresh the Page.
Upvotes: 3
Reputation: 6827
First, check with df -h
if the storage device is nearly full, if that's the case, then you need to free up some space.
Deleting old databases may be solution, but if you don't see a change in free space after the purge, then you need to do the following:
There's a common problem with some MySQL configurations in which all databases are stored in a single file called ibdata1
. What happens is that when you delete old databases this file does not shrink automatically.
Check the size of the files in /var/lib/mysql/
and if you see that ibdata1
size doesn't change after deleting some old databases, then you need to do some clean up.
Steps:
rm /var/lib/mysql/ibdata1
rm /var/lib/mysql/ib_logfile*
service mysql restart
Now, there should be enough space for /tmp
to grow and execute your queries!
Good luck!
Notes:
For more details on the purging visit John P's answer here: https://stackoverflow.com/a/3456885/2188595
Upvotes: 1