Anonymous - 2003-02-24

I'm not familiar with Php and Mysql, however I decided to build my WikiWeb site. Now I run PhpWiki 1.2.3, and I'd like to upgrade to PhpWiki 1.3.4. I can't make PhpWiki recognize my Mysql database!

What's DSN I must insert in index.php? My db name is database_it_db, my username is "username", I have no password... how can I put these data in index.php?

Here's the part of the file I'm not able to modify!

$DBParams = array(
   // Select the database type:
   // Choose ADODB or SQL to use an SQL database with ADODB or PEAR.
   // Choose dba to use one of the standard UNIX dbm libraries.
   //'dbtype' => 'ADODB',
   //'dbtype' => 'SQL',
   'dbtype'   => 'dba',
  
   // For SQL based backends, specify the database as a DSN
   // The most general form of a DSN looks like:
   //
   //   phptype(dbsyntax)://username:password@protocol+hostspec/database
   //
   // For a MySQL database, the following should work:
   //
   //   mysql://user:password@host/databasename
   //
   // FIXME: My version Pear::DB seems to be broken enough that there
   //        is no way to connect to a mysql server over a socket right now.
   //'dsn' => 'mysql://guest@:/var/lib/mysql/mysql.sock/test',
   //'dsn' => 'mysql://guest@localhost/test',
   //'dsn' => 'pgsql://localhost/test',

   // experimental
   'db_session_table'   => 'session',
  
   // Used by all DB types:

   // prefix for filenames or table names
   /*
    * currently you MUST EDIT THE SQL file too (in the schemas/
    * directory because we aren't doing on the fly sql generation
    * during the installation.
   */
   //'prefix' => 'phpwiki_',
  
   // Used only by 'dba'
   'directory'     => "/tmp",
   'dba_handler'   => 'gdbm',   // Either of 'gdbm' or 'db2' work great for me.
   //'dba_handler' => 'db2',
   //'dba_handler' => 'db3',    // Works fine on Windows, but not on every linux.
   //'dba_handler' => 'dbm',    // On sf.net redhat there's dbm and gdbm.
                                // dbm suffers from limits on size of data items?

   'timeout'   => 20,
   //'timeout' => 5
);

// Only for 'dbtype' => 'SQL'. See schemas/mysql.sql or schemas/psql.sql
//define('USE_DB_SESSION',true);

Thanks a lot!

Giorgio Baresi