You are viewing the PKP Support Forum | PKP Home Wiki

Unable to establish database connection

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

Unable to establish database connection

Postby kenzakreski » Sat Sep 11, 2004 1:32 am

Thank you for such a nice collection of code, this is great!!!

I am installing OJS on a testing server and am having difficulty with establishing the database connection. My error occurs on ... tep&step=2

I use my admin user name and password for the server, the default "ojs" for the database name, leave the other boxes unchecked but still get the message. see pdf screenshot

"Sorry, an error has occurred: Unable to establish database connection."

I checked my include/db/db.mysql.inc.php file for the correct function create statement (below). It has the correct statement as per Kevin's previous post.

// create a new database
function create_db($db) {
return mysql_query("create database $db", $this->connection);

The remaining steps return the same error message. Suggestions at this time of night ... would be welcome.

I am running OSX.2.4 no updates
with stock Apache Server
with Entropy php 4.3.4 http://www.php.net/downloads.php
and MySQL 4.0.20 http://dev.mysql.com/downloads/
Posts: 8
Joined: Sat Sep 11, 2004 12:45 am
Location: Gabriola Island BC

ojs version ojs-1.1.8.tar.gz and db changes

Postby kenzakreski » Sat Sep 11, 2004 12:16 pm

I am using the current version of ojs-1.1.8.tar.gz

I am also thinking at this stage I should be considering any db changes to the stock model. If we could adapt this structure to receive technical (applied radio practise and procedures) documents, my project "static" would be all but complete.
Posts: 8
Joined: Sat Sep 11, 2004 12:45 am
Location: Gabriola Island BC

Postby kevin » Sat Sep 11, 2004 2:24 pm

As the error message indicates, the script cannot connect to your database server using the connection parameters you've supplied. Typically this would indicate the server isn't running or the username/password you entered are not valid.

Assuming that you've verified that your database server is running and that you can connect to it using the same authentication credentials from the mysql command-line client, I would suggest editing include/db/db.mysql.inc.php and removing the error-suppressing "@" symbols (e.g., changing "@mysql_pconnect" to "mysql_pconnect"). This may cause a more detailed error message regarding why the connection failed to be printed.
Posts: 338
Joined: Tue Oct 14, 2003 8:23 pm

running fine now

Postby Ken » Mon Sep 13, 2004 10:46 pm

I started the mysql server using the clear instructions that come with the install.

completed the install

Then logged on to localhost as root user with out any password.

secured the system with a new password

completed the initial editor steps

renamed install files as .bak

running fine now, great web application. thanks for the help.

Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest