欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Delete all records from Drupal's session table (drupal.sessions)

shiping1 的头像

 Topic: Delete all records from Drupal's session table (drupal.sessions)  (Read 4907 times)

Offline craigntammy

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  •  
Just want to ask a question before I do the wrong thing....

Delete all records from Drupal's session table (drupal.sessions)

How do you do this?

I assume I can go to the sessions table in phpmyadmin click the check boxes next to...

uid
sid
hostname
timestamp    
cache    
session

and then click on empty in the menu

am I right or not  ???

just want to be sure

Thanks for your help
you guys rock
« Last Edit: August 19, 2007, 03:17:58 am by craigntammy »

Offline twowheeler

  • I post occasionally
  • **
  • Posts: 114
  • Karma: 11
    • Greater Harrisburg Youth For Christ
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #1 on: August 19, 2007, 04:30:19 am »
I don't think you need to click on the checkboxes next to the field names.  Once you have selected the sessions table, 'empty' should delete the records.  It will ask you to confirm before doing anything.

Personally I opened an SQL box and typed 'delete from sessions;' and that was it.  
 

Offline craigntammy

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  •  
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #2 on: August 19, 2007, 04:37:34 am »
Thanks 
it seemed to work

 

Offline Piotr Szotkowski

  • Administrator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 56
  •  
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #3 on: August 19, 2007, 09:09:37 am »
While DELETE does indeed work, it can take a bit of time on large tables.

TRUNCATE sessions; is the quickest MySQL way of emptying a given table (and this is what phpMyAdmin does when asked to empty a table).

Offline hallman

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 10
    • Greater Harrisburg Youth For Christ
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #4 on: August 22, 2007, 08:59:30 am »
Could someone please add to the instructions athttp://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+Drupal+Sites+from+v1.7+to+v1.8 
the commands to delete the drupal session table?

I haven't learned much MySQL yet, but so far have been able to just put my username, password, and database name into the commands you provide.

I have command line access so I can execute commands like
shell > mysql -u civicrm_user -h civicrm_db_server -pcivicrm_password civicrm_db 

and I can get into phpmyadmin, but I haven't done anything with it.

Judy Hallman
Judy Hallman

Offline Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4039
  • Karma: 122
    • Greater Harrisburg Youth For Christ
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #5 on: August 22, 2007, 09:44:05 am »
1. shell > mysql -u drupal_user -h drupal_db_server -pdrupal_password drupal_db
2. mysql> use drupal_db; (just to make sure right db is used)
3. mysql> TRUNCATE TABLE sessions;

HTH

Kurund
Found this reply helpful? Support CiviCRM

Offline craigntammy

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  •  
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #6 on: August 22, 2007, 09:54:11 am »
Could someone please add to the instructions athttp://wiki.civicrm.org/confluence/display/CRMDOC/Upgrading+Drupal+Sites+from+v1.7+to+v1.8 
the commands to delete the drupal session table?

I haven't learned much MySQL yet, but so far have been able to just put my username, password, and database name into the commands you provide.

I have command line access so I can execute commands like
shell > mysql -u civicrm_user -h civicrm_db_server -pcivicrm_password civicrm_db 

and I can get into phpmyadmin, but I haven't done anything with it.

Judy Hallman
 

I agree both command line and phpmyadmin instructions should be added

Offline Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4039
  • Karma: 122
    • Greater Harrisburg Youth For Christ
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Found this reply helpful? Support CiviCRM

Offline craigntammy

  • I’m new here
  • *
  • Posts: 16
  • Karma: 0
  •  
Re: Delete all records from Drupal's session table (drupal.sessions)
« Reply #8 on: August 22, 2007, 10:17:20 am »
Thanks for all you do!!!  ;D
 

 

普通分类: