Table not found error
ewwink - January 31, 2007 - 20:10
| Project: | Drupal vB |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | rszrama |
| Status: | closed |
Jump to:
Description
i see this error
user warning: Table '*****_vbforum.datastore' doesn't exist query: SELECT data FROM datastore WHERE title = 'options' in /home/*****/public_html/includes/database.mysql.inc on line 172.
how to fix?

#1
Looks like there's an error with the database prefixing... in your database, do your vBulletin tables all have a unique prefix, and has that been set in the config.php you copied into your drupalvb directory?
#2
my vbulletin prefix is "vb_" and i add this to setting.php but i still get that error
#3
Hmm.. you shouldn't set the db_prefix in your Drupal settings.php. It should already be set in your vBulletin config.php which you've copied into your drupalvb directory. Maybe double check to make sure the username and password as well as the vBulletin database name match up to what you put for $db_url['vbulletin']?
#4
i remove $db_prefix = 'vb_'; from setting.php, should i add $db_prefix = 'vb_'; in to config.php. bellow is default prefix in config.php
#5
Drupal vB takes the prefix from the $config settings you posted. No need to add $db_prefix in anywhere... it should just work.
#6
thanks for your response, i will wait and see........
#7
First: i am chinese. sorry my poor english.
I have the some problem.
i install the druapal and vBulletin in one database.
the vBulletin tables set the prefix 'vb_';
i am sure of the config.php in the drupalvb folder. Becasue when i renamed the config.php,i get a error.
Fatal error: require_once() [function.require]: Failed opening required 'modules/drupalvb/config.php' (include_path='.;D:\Apache\php\pear') in D:\www\twittown\modules\drupalvb\drupalvb.inc.php on line 55
Now ,i get the error message.
* user warning: Table 'drupal5_twittown.datastore' doesn't exist query: SELECT data FROM datastore WHERE title = 'options' in D:\www\twittown\includes\database.mysql.inc on line 172.
* user warning: Table 'drupal5_twittown.user' doesn't exist query: SELECT userid, username, usergroupid, usertitle, pmtotal, pmunread FROM user WHERE username = '' in D:\www\twittown\includes\database.mysql.inc on line 172.
these talbes have the prefix "vb_": durpal5_twittown.vb_datastore.
settings.php
$db_url['default'] = 'mysql://username:pass@localhost/drupal5_twittown';
$db_url['vbulletin'] = 'mysql://username:pass@localhost/drupal5_twittown';
$db_prefix = '';
what can i do??
#8
more info???what????
#9
oh,sorry,it's not work time!
#10
#11
It should, yet if it doesn't? I'm having the same issues above. config.php (in /sites/all/modules/drupalvb) is the same as settings.php (in /sites/default/settings.php)
Yet, the db_prefix isn't be noticed. Ideas?
user warning: Table 'me_vbtest.datastore' doesn't exist query: SELECT data FROM datastore WHERE title = 'options' in /var/www/includes/database.mysql.inc on line 172.Should be
me_vbtest.vb354_datastore.From config.php
$config['Database']['tableprefix'] = 'vb354_';#12
So is there any progress with that? I tried all of the suggestions above still no luck.
Will try to provide information. My website is installed into http://www.example.com/guild - drupal here and the forum is in: http://www.example.com/guild/forum
Both installed and working except when i try to migrate i gate the errors:
user warning: Table 'tdsguild.datastore' doesn't exist query: SELECT data FROM datastore WHERE title = 'options' in /www/06/example.com/guild/includes/database.mysql.inc on line 172.
This is my settings.php from sites/default in drupal:
$db_url['default'] = 'mysql://tdsguild:password@mysqlserver/tdsguild';
$db_url['vbulletin'] = 'mysql://tdsguild:password@mysqlserver/tdsguild';
$db_prefix = 'drupal_';
This comes from vbuleltin config.php:
//Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = 'forum_';
Seems to be something wrong as the table: forum_datastore exists in the database if you need more info just ask. If you have a solution would like to hear that.
#13
OK i can now say where the problem is.
I installed my vbulletin with the prefix forum_ :
$config['Database']['tableprefix'] = 'forum_';
It did not work read above.
then i instaled my vbulletin with no prefix:
$config['Database']['tableprefix'] = '';
Worked like a charm i guess that "_" is not picked up correctly. I tried modifying it in numerous ways with no success.
I don't know how to help others who have vBulletins already installed and have loads of posts but hopefully mine will help someone. Just install vBulletin without the prefix. Should work. And lets hope developers will be able to fix it.
#14
okay.. this helped me a lot... and i want to pass on to others who may be stuck on stupid like i was....
$db_url['default'] = 'mysql://drupal_user_name_here:drupal_password_here@localhost/drupal_database_name_here';
$db_url['vbulletin'] = 'mysql://vbulletin_username_here:vbulletin_password_here@localhost/vbulletin_database_name_here';
$db_prefix = '';
when i got this right... it ran perfectly.... good luck...
#15
Same problem here. I'm using vb 3.6.8 and drupal 5.2.
I prefixed the drupal install with "drupal_".
VBulletin has "vb_" as prefix. For some reason the plugin doesn't include the prefix from vb's config file.
I think it's a problem with in the drupalvb.inc.php file from the drupalvb module.
function _drupalvb_prefix($sql) {
$vbulletin = _drupalvb_vb_init(FALSE, TRUE, FALSE);
return strtr($sql, array('{' => $vbulletin->config['Database']['tableprefix'], '}' => ''));
}
I'm investigating it now. I hope i can find the problem before the sun comes up :)
#16
i found out what caused this problem and emailed the developer. Hope it gets fixed soon!
#17
I'm having the same problem. New install of drupal 5.2 with existing vbulletin 3.6.3
Warning: Table 'beta_forum.system' doesn't exist query: SELECT * FROM system WHERE type = 'theme' in /home/beta/public_html/includes/database.mysql.inc on line 172
Assistance is appreciated
#18
Well could you please tell us what caused the error?
#19
It is a problem with this function found in drupalvb.inc.php
function _drupalvb_prefix($sql) {
$vbulletin = _drupalvb_vb_init(FALSE, TRUE, FALSE);
return strtr($sql, array('{' => $vbulletin->config['Database']['tableprefix'], '}' => ''));
}
i'm not sure what it is and I know it's a crap solution but you could hard code the table prefix in this function like i did and it works like a charm now
Now my function now looks like
function _drupalvb_prefix($sql) {
$vbulletin = _drupalvb_vb_init(FALSE, TRUE, FALSE);
//return strtr($sql, array('{' => $vbulletin->config['Database']['tableprefix'], '}' => ''));
return strtr($sql, array('{' => 'vb_', '}' => ''));
}
where vb_ is my table prefix
#20
at3r, your solution made all the difference. Thank you for assisting. I'm surprised it hasn't been included in the final downloaded file.
#21
Hi
I've tried what's shown in this post and it doesn't work for me:
My settings.php looks like:
$db_url['default'] = 'mysql://drupal-user:drupal-password@localhost/drupal-mysql';
$db_url['vbulletin'] = 'mysql://vbulletin-user:vbulletin-password@localhost/vbulletin-mysql';
$db_prefix = '';
And I moddified the drupalvb.inc.php file to change the function to looks like:
function _drupalvb_prefix($sql) {
$vbulletin = _drupalvb_vb_init(FALSE, TRUE, FALSE);
//return strtr($sql, array('{' => $vbulletin->config['Database']['tableprefix'], '}' => ''));
return strtr($sql, array('{' => 'vbu_', '}' => ''));
}
...since my vbulletin prefix is vbu_
But I get this error:
user warning: Table 'm_drupal.vbu_usergroup' doesn't exist query: SELECT usergroupid, title FROM vbu_usergroup in /home/marciano/www/includes/database.mysql.inc on line 172.
Thanks in advance for any suggestion or help.
EDIT: In the error message, it says 'm_drupal.vbu_usergroup' doesn't exist, but it actually has to search for 'vbulletin-mysql.vbu_usergroup'. So, seems it reads config.php (from vbulletin) right but it doesn´t read right information from settings.php
#22
I solved the main problem, it was a stupid mistake.
When I uploaded the modified 'settings.php' file through ftp, it did not actually uploaded because the file attributes. I unprotected the file and I uploaded it.
I don´t get errors anymore, but the module seems not to be working right. It doesn't take any information from vbulletin forum. I think this could be because I have vbulletin forum and drupal in different domains (actually, drupal in a subdomain).
What should I change to override it?
Thanks again.
#23
Here's the bug in detail peeps! I already found this out a while ago, but didn't have the time to fix it then. I send this mail to the author, but no response yet. I might fix it, because i need this module as well.
i tried to install your drupalvb module. It worked fine, until it started to complain it didn't find the vb tables in the sql database. Of course i could have removed the vb_ prefix from my vbulletin table... But i decided
to dig deeper. I found out i am not the only one with the problem.
I opened your php files and discovered the problem was in
drupalvb.inc.php. _drupalvb_fetch_config() causes the problem. The test
page in drupal i was using was:
http://localhost/~roel/drupal/?q=admin/settings/drupalvb (try it, so you
can reproduce the error)
//Function to grab the configuration/options of the vB installation
function _drupalvb_fetch_config() {
$config = array();
require_once('config.php');
return $config;
}
if you add print_r($config) (yes, nasty debug hacking :-)), you see that the first time it prints the $config array/object properly, but the second time the function is called, the array is empty!
function _drupalvb_fetch_config() {
$config = array();
require_once('config.php')
print_r($config);
return $config;
}
_drupalvb_fetch_config() should only be called once.
$config should contain the prefix of my vb tables. So that's the problem, when it gets loaded the 2nd time. The problem is related to require once. This function loads it the first time, then copies the $config from that file and returns it. But the 2nd time, it doesn't load the file, so all
it returns is an empty array, defind above. I can create a fix for it, but as i'm not familiar to drupal, i thought it's better if the developer did it.
#24
Ahh, thanks. Support for this module is tough for me since my company decided not to use it, and I'm also not sure of the license restrictions related to blending vB/Drupal... the fix will be to change:
<?php$config = array();
?>
to
<?phpstatic $config = array();
if (!empty($config)) {
return $config;
}
?>
#25
Hello all, i'm having the same problem and i did all that you guys did here but the problem remains :S
Vbb prefix in the both config files
// ****** TABLE PREFIX ******// Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = 'vb_';
drupals config file:
$db_url = 'mysql://root@localhost/drupal';$db_url['vbulletin'] = 'mysql://root@localhost/vb';
$db_prefix = '';
can somebody please help me ??
edit: it seems its not making any connection to the Vbb database cause its searching the tables inmy drupal database :s
#26
Drupalvb 5.x-2.x implements a completely overhauled database interface to vBulletin now. A development snapshot should be available within the next 12 hours. A first release candidate will follow in the next days.
#27
Automatically closed -- issue fixed for two weeks with no activity.