PDA

View Full Version : Syntax for dbsource?



JJZolx
2006-07-08, 09:05
To run with a separate installation of MySQL, what's the syntax to use in the dbsource setting in the prefs file? Here's what I had prior to the merging of the split-scanner branch:

dbsource: dbi:mysql:dbname=slimserver

Here are the new default settings using the Slim installed MySQL:

dbsource: dbi:mysql:hostname=127.0.0.1;port=9092;database=%s

Are the hostname and port required or will they default to localhost and to the standard MySQL port? Do you just substitute the database name in place of '%s'?

Dan Sully
2006-07-08, 10:16
* JJZolx shaped the electrons to say...

>Here are the new default settings using the Slim installed MySQL:
>
>dbsource: dbi:mysql:hostname=127.0.0.1;port=9092;database=%s
>
>Are the hostname and port required or will they default to localhost
>and to the standard MySQL port? Do you just substitute the database
>name in place of '%s'?

They will default. %s gets substituted to 'slimserver'.

This is my dbsource line:

dbsource: dbi:mysql:database=%s

-D
--
On a long enough timeline, the survival rate for everyone drops to zero.

JJZolx
2006-07-08, 10:29
* JJZolx shaped the electrons to say...

>Here are the new default settings using the Slim installed MySQL:
>
>dbsource: dbi:mysql:hostname=127.0.0.1;port=9092;database=%s
>
>Are the hostname and port required or will they default to localhost
>and to the standard MySQL port? Do you just substitute the database
>name in place of '%s'?

They will default. %s gets substituted to 'slimserver'.

This is my dbsource line:

dbsource: dbi:mysql:database=%s
So for a database name other than 'slimserver', I take it that it's simply

dbsource: dbi:mysql:database=someothername

What was 'dbname' prior to the merge is now 'database'?

Dan Sully
2006-07-08, 10:33
* JJZolx shaped the electrons to say...

>dbsource: dbi:mysql:database=someothername

Yes.

>What was 'dbname' prior to the merge is now 'database'?

'dbname' was the syntax that the SQLite driver used.

To see the syntax for a particular driver:

perldoc DBD::mysql
perldoc DBD::SQLite

etc.

-D
--
<iNoah> all your base class are belong to us