2
votes

Can I empty the table 'accesslog' in Drupal ? Does it contain only logs ?

It is giving me issues in importing a database into a new mysql server:

Error at the line 66: INSERT INTO accesslog (aid, sid, title,
path, url, hostname, uid,
timer, timestamp) VALUES(5686,
'bgp2qr643sg0aoreq7p524ii96', 'Modules', 'admin/build/modules',
'http://localhost/drupal/node/26/edit?destination=admin%2Fcontent%2Fnode',
'127.0.0.1', 1, 2724, 1273997919);

Actually the issue is not there.. I've deleted that table just to see if I was able to import the database and I get a similar error for the next table to import:

Error at the line 60: INSERT INTO actions (aid, type, callback, parameters, description)
VALUES('comment_unpublish_action', 'comment', 'comment_unpublish_action', '', 'Unpublish comment');
Query: —

INSERT INTO actions (aid, type, callback, parameters, description) VALUES('comment_unpublish_action', 'comment', 'comment_unpublish_action', '', 'Unpublish comment');
MySQL: Duplicate entry 'comment_unpublish_action' for key 1

thanks

1

1 Answers

1
votes

Per your original question: yes, accesslog can be safely emptied, as can watchdog and any tables beginning with "cache".

As for the import errors, make sure that the destination database is empty before attempting to import a complete dump. If you don't want to drop all the tables from the destination database each time, create your complete dump with "DROP TABLE IF EXISTS" statements. In phpMyAdmin, for example, you can do this with the "Add DROP TABLE / VIEW / PROCEDURE / FUNCTION" option in the Export tab.