vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Query to Restore vb_session Table (https://vborg.vbsupport.ru/showthread.php?t=303090)

Digital Jedi 10-07-2013 05:49 PM

Query to Restore vb_session Table
 
Is this the correct query to restore the vb_session table on vB 3.8.5?

[sql]CREATE vb_session (
sessionhash CHAR(32) NOT NULL DEFAULT '',
userid INT UNSIGNED NOT NULL DEFAULT '0',
host CHAR(15) NOT NULL DEFAULT '',
idhash CHAR(32) NOT NULL DEFAULT '',
lastactivity INT UNSIGNED NOT NULL DEFAULT '0',
location CHAR(255) NOT NULL DEFAULT '',
useragent CHAR(100) NOT NULL DEFAULT '',
styleid SMALLINT UNSIGNED NOT NULL DEFAULT '0',
languageid SMALLINT UNSIGNED NOT NULL DEFAULT '0',
loggedin SMALLINT UNSIGNED NOT NULL DEFAULT '0',
inforum SMALLINT UNSIGNED NOT NULL DEFAULT '0',
inthread INT UNSIGNED NOT NULL DEFAULT '0',
incalendar SMALLINT UNSIGNED NOT NULL DEFAULT '0',
badlocation SMALLINT UNSIGNED NOT NULL DEFAULT '0',
bypass TINYINT NOT NULL DEFAULT '0',
profileupdate SMALLINT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (sessionhash)
);[/sql]

Yeah. I know. Missing table. Not good. :erm:

nerbert 10-07-2013 06:14 PM

1 Attachment(s)
I thought there was a way to get the sql printed out for the table structure but I couldn't find it. You can check it with this from vB3.7.3. It looks like you have to specify the number of chars for smallint and tinyint

Digital Jedi 10-08-2013 12:26 AM

So more like...

[sql]CREATE vb_session (
sessionhash CHAR(32) NOT NULL DEFAULT '',
userid INT CHAR(10) NOT NULL DEFAULT '',
host CHAR(15) NOT NULL DEFAULT '',
idhash CHAR(32) NOT NULL DEFAULT '',
lastactivity INT CHAR(10) NOT NULL DEFAULT '',
location CHAR(255) NOT NULL DEFAULT '',
useragent CHAR(100) NOT NULL DEFAULT '',
styleid SMALLINT CHAR(5) NOT NULL DEFAULT '',
languageid SMALLINT CHAR(5) NOT NULL DEFAULT '',
loggedin SMALLINT CHAR(5) NOT NULL DEFAULT '',
inforum SMALLINT CHAR(5) NOT NULL DEFAULT '',
inthread INT CHAR(10) NOT NULL DEFAULT '',
incalendar SMALLINT CHAR(5) NOT NULL DEFAULT '',
badlocation SMALLINT CHAR(5) NOT NULL DEFAULT '',
bypass TINYINT CHAR(4) NOT NULL DEFAULT '',
profileupdate SMALLINT CHAR(5) NOT NULL DEFAULT '',
PRIMARY KEY (sessionhash)
);[/sql]

Or do I need to specify INT, too?

--------------- Added [DATE]1381196910[/DATE] at [TIME]1381196910[/TIME] ---------------

I went ahead and tried both of these. But nothing happens. No tables are created. No errors are thrown up. I've been stuck on this one all day.

nerbert 10-08-2013 01:11 AM

Try this:
[sql]
CREATE TABLE vb_session (
sessionhash CHAR(32) NOT NULL DEFAULT '',
userid INT(10) NOT NULL DEFAULT '0',
host CHAR(15) NOT NULL DEFAULT '',
idhash CHAR(32) NOT NULL DEFAULT '',
lastactivity INT(10) NOT NULL DEFAULT '0',
location CHAR(255) NOT NULL DEFAULT '',
useragent CHAR(100) NOT NULL DEFAULT '',
styleid SMALLINT(5) NOT NULL DEFAULT '0',
languageid SMALLINT(5) NOT NULL DEFAULT '0',
loggedin SMALLINT(5) NOT NULL DEFAULT '0',
inforum SMALLINT(5) NOT NULL DEFAULT '0',
inthread INT(10) NOT NULL DEFAULT '0',
incalendar SMALLINT(5) NOT NULL DEFAULT '0',
badlocation SMALLINT(5) NOT NULL DEFAULT '0',
bypass TINYINT(4) NOT NULL DEFAULT '0',
profileupdate SMALLINT(5) NOT NULL DEFAULT '0',
PRIMARY KEY (sessionhash)
);
[/sql]

But there are a lot of people here a lot better than I am with sql.

Where are you doing this? In your admin CP? I would just do it with phpMyAdmin in cPanel.

EDIT: What happened to all those default values of '0'? Those should all be in there. I put them back in.

Digital Jedi 10-08-2013 01:32 AM

I tried phpMyAdmin first. Then I tried to run the querys through tools.php, since I can't get the forum to load without vb_session. Sorry, I thought the 0s went out once you added the CHARS. That's what I get for guessing.

--------------- Added [DATE]1381199746[/DATE] at [TIME]1381199746[/TIME] ---------------

Quote:

Originally Posted by nerbert (Post 2450812)
Try this:
[sql]
CREATE TABLE vb_session (
sessionhash CHAR(32) NOT NULL DEFAULT '',
userid INT(10) NOT NULL DEFAULT '0',
host CHAR(15) NOT NULL DEFAULT '',
idhash CHAR(32) NOT NULL DEFAULT '',
lastactivity INT(10) NOT NULL DEFAULT '0',
location CHAR(255) NOT NULL DEFAULT '',
useragent CHAR(100) NOT NULL DEFAULT '',
styleid SMALLINT(5) NOT NULL DEFAULT '0',
languageid SMALLINT(5) NOT NULL DEFAULT '0',
loggedin SMALLINT(5) NOT NULL DEFAULT '0',
inforum SMALLINT(5) NOT NULL DEFAULT '0',
inthread INT(10) NOT NULL DEFAULT '0',
incalendar SMALLINT(5) NOT NULL DEFAULT '0',
badlocation SMALLINT(5) NOT NULL DEFAULT '0',
bypass TINYINT(4) NOT NULL DEFAULT '0',
profileupdate SMALLINT(5) NOT NULL DEFAULT '0',
PRIMARY KEY (sessionhash)
);
[/sql]

But there are a lot of people here a lot better than I am with sql.

Where are you doing this? In your admin CP? I would just do it with phpMyAdmin in cPanel.

EDIT: What happened to all those default values of '0'? Those should all be in there. I put them back in.

Oh brother, I was running them through the wrong box in phpMyAdmin. <facepalm> Can you tell I don't know what I'm doing? This worked. Thanks!

But...

Yeah, I just now noticed that I'm missing more than vb_session. vb_user is gone, too. I hate SSL, but I'm going to see if I can run one of my last backups. It's probably not very current. But I seldom did them when my site started slowing down. Thanks again, though.

snakes1100 10-08-2013 03:22 AM

You can get any table creation query out of your mysql-schema.php file in the install dir for future reference.


All times are GMT. The time now is 07:04 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00973 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete