Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Install: database server is not configured

Locked
Gordon
Posts: 4
Joined: Sat Jan 09, 2016 5:23 am

Install: database server is not configured

Unread post by Gordon »

I have installed alot of other software on my server and have experience with MySQL but this one has me stumped:

1. Download nuBuilderPro and upload to my server, run unzip | Result: Ok
2. Create MySql DB on host | Result: Ok
3. Create config.php with MySql parms and upload to nuBuilderPro directory | Result: Ok
4. Execute nuinstall.php | Result: Fail DB not configured
5. Check MySql DB in Starfield | Result: Ok
6. Create test.php with MySql parms, upload and run | Result: Ok
7. Change DB password remove special characters, edit config.php with new password, retry nuinstall.php | Result: Fail DB not configured
8. Edit config.php replace host name with 127.0.0.1 (although I already know this will not be correct), retry nuinstall.php | Result: Fail DB not configured
9. Edit config.php replace host name with DB IP address, retry nuinstall.php | Result: Fail DB not configured
10. My program test.php can still connect to DB
11. Create program test1.php to select data from table named test
12. Upload and run test1.php | Result: Ok

Any thoughts or suggestions?
Untitled-1.jpg
Untitled-1.jpg (387.77 KiB) Viewed 9144 times
Gordon
Posts: 4
Joined: Sat Jan 09, 2016 5:23 am

Update: Install: database server is not configured

Unread post by Gordon »

1) modified nuinstall_lib.php with the following code:
function checkDatabaseConnection() {

$DBHost = $this->DB['DBHost'];
$DBUserID = $this->DB['DBUserID'];
$DBPassWord = $this->DB['DBPassWord'];
$DBName = $this->DB['DBName'];

$con = false;
$con = mysql_connect($DBHost,$DBUserID,$DBPassWord);

print("<br>DBHost: $DBHost <br>");
print("DBUserID: $DBUserID <br>");
print("DBPassword: $DBPassWord <br>");
print("DBName: $DBName <br>");
print("Con: $con <br>");
die("Connection Killed");

if ($con === false) {
return false;
} else {
return true;
}
}

Result 1:
DBHost:
DBUserID:
DBPassword:
DBName:
Con:
Connection Killed

2) hard coded the DB values:
function checkDatabaseConnection() {

$DBHost = "NBP8753809760.db.9315233.hostedresource.com";
$DBUserID = "NBP8753809760";
$DBPassWord = "N976rfhjkgvcjhgFDSYTERYTFvckjtfuio7ytiybh@";
$DBName = "NBP8753809760";

$con = false;
$con = mysql_connect($DBHost,$DBUserID,$DBPassWord);

print("<br>DBHost: $DBHost <br>");
print("DBUserID: $DBUserID <br>");
print("DBPassword: $DBPassWord <br>");
print("DBName: $DBName <br>");
print("Con: $con <br>");
die("Connection Killed");

if ($con === false) {
return false;
} else {
return true;
}
}

Result 2:
DBHost: NBP8753809760.db.9315233.hostedresource.com
DBUserID: NBP8753809760
DBPassword: N976rfhjkgvcjhgFDSYTERYTFvckjtfuio7ytiybh@
DBName: NBP8753809760
Con: Resource id #4
Connection Killed

3) add a select statement to nuinstall_lib.php
function checkDatabaseConnection() {

$DBHost = "NBP8753809760.db.9315233.hostedresource.com";
$DBUserID = "NBP8753809760";
$DBPassWord = "N976rfhjkgvcjhgFDSYTERYTFvckjtfuio7ytiybh@";
$DBName = "NBP8753809760";

$con = false;
$con = mysql_connect($DBHost,$DBUserID,$DBPassWord);

$usertable = "test";
$yourfield = "your_field";
mysql_select_db($DBName);
$query = "SELECT * FROM $usertable";
$result = mysql_query($query);

if ($result) {
while($row = mysql_fetch_array($result)) {
$name = $row["$yourfield"];
echo "<br>Data: $name<br>";
}
}

die("Connection Killed");

if ($con === false) {
return false;
} else {
return true;
}
}

Result:
Data: This is the query result from test
Connection Killed

So IMO checkDatabaseConnection will always fail because no data is passed to mysql_connect()
Gordon
Posts: 4
Joined: Sat Jan 09, 2016 5:23 am

Re: Install: database server is not configured

Unread post by Gordon »

MySQL version
5.5 (Direct access allowed)

PHP version 5.4
Gordon
Posts: 4
Joined: Sat Jan 09, 2016 5:23 am

Re: Install: database server is not configured

Unread post by Gordon »

Did another clean install and got it working. Cheers!
admin
Site Admin
Posts: 2781
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 1 time

Re: Install: database server is not configured

Unread post by admin »

.
Locked