Hi,
I'm struggling trying to get
DatabasePlugin working. Symptoms: when I create a test page with %DATABASE_SQL{description="twiki" sql="select * from test_table"}%
I get "No such DB twiki at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 314. "
My configuration:
- 'sid' => ''
- 'hostname' => 'localhost'
- 'description' => 'twiki'
- 'username' => 'twiki'
- 'database' => 'twiki'
- 'password' => 'twiki'
- 'table_name' => ''
- 'driver' => 'mysql'
Checks already done:
- I do have a table called "test_table"
- user twiki@localhost does have privileges granted on db twiki
- setting the extension to "Remote" (with localhost) causes a even worse "Software error"
- all perl DB connection modules seems to be working, since I was able to successfully run a perl script which makes a query
One weird thing I noticed is that, using the web configuration, TWiki doesn't seem to be able to modify the Config.spec file. I need to open it and manually edit with correct values...
Any ideas? Is there any log file I can check?
Many thanks, Thomas
--
Thomas Fozzi - 2013-03-04
Discussion and Answer
Installing and configuring the proper DBI drivers can be a pain.
Not sure if helpful, here is a sample that worked for me a few years back:
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigSource} = 'Local';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigHost} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigDriver} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigDB} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigSID} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigTable} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigUsername} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigPassword} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{Databases} = [
{
'hostname' => 'cherry.sequoiacap.com;port=1433;charset=windows-1252;tds version=8.0',
'description' => 'SomeData',
'username' => 'some\twikisvc',
'database' => 'SomeData',
'password' => 'SomePassword',
'table_name' => '',
'driver' => 'Sybase'
},
];
$TWiki::cfg{Plugins}{DatabasePlugin}{EditURLPrefix} = 'https';
$TWiki::cfg{Plugins}{DatabasePlugin}{EditURLPath} = 'phpMyAdmin-2.2.2-rc1';
--
Peter Thoeny - 2013-03-05
Hi Peter, thank you very much for your answer! I copied the lines in my
LocalSite.cfg
file, modified as follows:
$TWiki::cfg{Plugins}{RevisionLinkPlugin}{Enabled} = 1;
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigSource} = 'Local';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigHost} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigDriver} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigDB} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigSID} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigTable} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigUsername} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{ConfigPassword} = '';
$TWiki::cfg{Plugins}{DatabasePlugin}{Databases} = [
{
'hostname' => 'localhost',
'description' => 'twiki',
'username' => 'twiki',
'database' => 'twiki',
'password' => 'twiki',
'table_name' => '',
'driver' => 'mysql'
},
];
$TWiki::cfg{Plugins}{DatabasePlugin}{EditURLPrefix} = 'https';
$TWiki::cfg{Plugins}{DatabasePlugin}{EditURLPath} = 'phpMyAdmin-2.2.2-rc1';
$TWiki::cfg{Plugins}{DatabasePlugin}{Enabled} = 1;
1;
The
$TWiki::cfg{Plugins}{DatabasePlugin}{Databases} field was not present in the file at all. And... it works !!!
I guess the problem was related to the fact that the configuration web page for some reason wasn't able to modify
LocalSite.cfg
(after entering configuration and saving, when I returned to the configuration page I used to see again the default values).
Thank you very much!
Thomas
--
Thomas Fozzi - 2013-03-05
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.