{"id":9005,"date":"2024-08-30T07:32:02","date_gmt":"2024-08-30T07:32:02","guid":{"rendered":"https:\/\/www.infinitivehost.com\/knowledge-base\/?p=9005"},"modified":"2024-08-31T08:07:56","modified_gmt":"2024-08-31T08:07:56","slug":"how-to-clear-the-user-access-log-vtigercrm-7-3-open-source","status":"publish","type":"post","link":"https:\/\/www.infinitivehost.com\/knowledge-base\/how-to-clear-the-user-access-log-vtigercrm-7-3-open-source\/","title":{"rendered":"How to Clear the User Access Log VTigerCRM 7.3 (Open Source)"},"content":{"rendered":"<div class='epvc-post-count'><span class='epvc-eye'><\/span>  <span class=\"epvc-count\"> 1,782<\/span><span class='epvc-label'> Views<\/span><\/div>\n<p>To clear the user access log in VtigerCRM 7.3 (open source), you&#8217;ll need to delete the entries from the <code>vtiger_loginhistory<\/code> table, which stores the user access logs.<\/p>\n\n\n\n<p>Here&#8217;s how you can do it:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Method 1: Using phpMyAdmin or MySQL CLI<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Access the Database:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open phpMyAdmin or connect to your MySQL database using a command-line interface.<\/li>\n<\/ul>\n\n\n\n<p>    2. <strong>Select the Vtiger Database:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the following SQL command to select the database (replace <code>your_database_name<\/code> with your actual Vtiger database name):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">USE your_database_name;<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Clear the User Access Log:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run the following SQL command to delete all records from the <code>vtiger_loginhistory<\/code> table:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">DELETE FROM vtiger_loginhistory;<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>Optimize the Table (Optional):<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can optimize the table after deleting the records to reclaim storage space:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">OPTIMIZE TABLE vtiger_loginhistory;<\/mark><\/code><\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Method 2: Using a Custom Script<\/h3>\n\n\n\n<p>If you prefer not to use the database directly, you can create a custom PHP script to clear the user access logs:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a PHP Script:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a new PHP file (e.g., <code>clear_user_access_log.php<\/code>) in the root directory of your Vtiger installation.<\/li>\n<\/ul>\n\n\n\n<p>    2. <strong>Add the Following Code to the PHP Script:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">&lt;?php\n   require_once 'includes\/main\/WebUI.php';\n\n   global $adb;\n\n   \/\/ Clear the user access log\n   $query = \"DELETE FROM vtiger_loginhistory\";\n   $adb-&gt;pquery($query, array());\n\n   echo \"User access log cleared successfully.\";\n   ?&gt;<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Run the Script:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Execute the script by accessing it via a web browser:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>   <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">http:\/\/your-crm-url\/clear_user_access_log.php<\/mark><\/code><\/code><\/pre>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li><strong>Delete the Script:<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>For security reasons, remove the script after you have successfully run it.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Important Notes<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Backup Your Database:<\/strong> Before performing any deletion operation, make sure to backup your database to avoid accidental data loss.<\/li>\n\n\n\n<li><strong>Permissions:<\/strong> Ensure that the database user has the necessary permissions to delete records from the table.<\/li>\n<\/ul>\n\n\n\n<p>By following either method, you can clear the user access log in Vtiger CRM 7.3.<\/p>\n\n\n\n<p><strong>Conclusion<\/strong><\/p>\n\n\n\n<p>To easily clear the log-in access of a user in Vtiger CRM 7.3 (basically an open source), you just have to delete all the entries from the table named vtiger_loginhistory, which usually contains the logs of user access with the <a href=\"https:\/\/www.infinitivehost.com\/managed-vtiger-solutions\"><mark style=\"background-color:#8ed1fc\" class=\"has-inline-color\"><strong>best Vtiger hosting solutions<\/strong><\/mark><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1,782 Views To clear the user access log in VtigerCRM 7.3 (open source), you&#8217;ll need to delete the entries from the vtiger_loginhistory table, which stores the user access logs. Here&#8217;s how you can do it: Method 1: Using phpMyAdmin or MySQL CLI 2. Select the Vtiger Database: Method 2: Using a Custom Script If you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[204],"tags":[],"class_list":["post-9005","post","type-post","status-publish","format-standard","hentry","category-vtiger-solutions"],"_links":{"self":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/9005","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/comments?post=9005"}],"version-history":[{"count":2,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/9005\/revisions"}],"predecessor-version":[{"id":9042,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/posts\/9005\/revisions\/9042"}],"wp:attachment":[{"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/media?parent=9005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/categories?post=9005"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.infinitivehost.com\/knowledge-base\/wp-json\/wp\/v2\/tags?post=9005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}