Welcome to the nuBuilder forums!

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

Installation and password problem

Locked
mklante
Posts: 14
Joined: Tue Sep 18, 2012 12:44 pm

Installation and password problem

Unread post by mklante »

Installation problem

Hello,

(using OS X (lion) and MAMP on a local machine)

Installed Nubuilder and I can open the sample database with user: globeadmin pwd:123

Then I copied “sample” DB with PHPmyadmin called “nubuild”

changed the config.php and the index.php. It always gives me a login error. I thought the problem is in the MAMP distribution and installed XAMP but it is the same the only difference is that XAMPP issues an error

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'XXXXX'@'localhost' (using password: YES) in /Applications/XAMPP/xamppfiles/htdocs/nubuilder/productionnu2/dbfunctions.php on line 62
Could not connect to database

Again “sample” opens no problem so I presume it could not be a database connection issue.

Please help.

Kind regards

Michael
pickle_jimmy
Posts: 38
Joined: Mon Jul 25, 2011 4:00 am

Re: Installation and password problem

Unread post by pickle_jimmy »

Hi Michael, (and interested onlookers :-/ )

Let me attempt to explain how nuBuilder sites and database connections work in general and this - I hope - will answer your question. If not, feel free to let me know.

1) The sample database (sample.sql) is probably a misnomer - it should probably be called "blank" because it contains the essential tables for a "blank" nuBuilder site. So, first step in creating a nuBuilder site is - Go into PHPMyAdmin, create a new database (call it something that helps you recognise which site it is for), and using the import function, import the sample.sql file. This contains a bunch of create table and insert statements to create a blank site...

1a) IMPORTANT NOTE (sorry for yelling) - before you import the sample.sql file, you might want to edit it in some kind of text editor (like notepad++ or vi) and check that the first four lines do NOT look like this:

CREATE DATABASE IF NOT EXISTS sample;
USE sample;
CREATE USER 'sample'@'localhost' IDENTIFIED BY 'samplepass';
GRANT ALL PRIVILEGES ON `sample` . * TO 'sample'@'localhost' WITH GRANT OPTION;

As you can see - this creates a database called "sample" and a user to use the "sample" database. If you are creating a new database - and dont want it to be called sample, remove these lines and re-save sample.sql

(Note #2: if you already have the sample database loaded - you can copy it to a new database in PHPMyAdmin without needing to import anything)

1b) You then need to create a database user with privileges to access this database - make note of the username/password combo as you will need these for your config.php file. You can do all this in PHPMyAdmin - if you are unfamiliar with creating users and assigning privileges, google is your friend here. You could also just use the 2 bottom lines above (Create User and Grant Privileges) - change the database it refers to and the username and password, past it into PHPMyAdmin, and you're done.

OK - 90% of the way there - you have a database, and you have a user/password that can access that database.

2) nuBuilder has 2 directories in its webroot. The directory containing the main nuBuilder code - usually called productionnu2, but is could be different - and the "db" directory - this is where your sites are. In this directory, there is a directory called "sample". Copy this directory and its contents and give it a name that helps you recognise what it is.

2a) edit the config.php in the new folder you created, and change the following variables to match what you just created in PHPMyAdmin
$DBName = "sample";
$DBUser = "sample";
$DBPassword = "samplepass";

2b) edit index.php in the new folder you just created, and change the following variables to match the folder name (and site) you just created
$dbfolder = "sample";
$nameText = "Sample";

That's it.

Where you got to the sample site with http://localhost/db/sample/
You get to your new site with http://localhost/db/newsite/

Hope this helps

Pickle Jimmy
mklante
Posts: 14
Joined: Tue Sep 18, 2012 12:44 pm

Re: Installation and password problem

Unread post by mklante »

Thank You for your help and your detailed instructions.

Unfortunately it did not solve the problem

Still I cannot login it always kicks me back with the following error

http://localhost:8888/nubuilder/product ... db/mynewdb

Here is what I did

deleted all previous user, db with phpmyadmin
changed in sample.sql

CREATE DATABASE IF NOT EXISTS mynewdb;
USE mynewdb;
CREATE USER 'mynewdb'@'localhost' IDENTIFIED BY 'mynewdbpass';
GRANT ALL PRIVILEGES ON `mynewdb` . * TO 'mynewdb'@'localhost' WITH GRANT OPTION;

saved as mynewdb.sql

imported with phpmyadmin


changed config.php

$DBHost = "localhost:8889";
$DBName = "mynewdb";
$DBUser = "mynewdb";
$DBPassword = "mynewdbpass";
$DBGlobeadminPassword = "mynewdbglobeadmin";


changed index.php

<?php
$dbfolder = "mynewdb";
$nameText = "mynewdb";
$build = "productionnu2";
?>



When I enter the URL
localhost:8888/nubuilder/db/mynewdb

it gives me the input (I know it is the right folder because I changed the logo)

if I enter user:mynewdb pwd:mynewdbpass
or user:globeadmin pwd globeadminpass
or user:globeadmin pwd:123

it always kicks me back to
http://localhost:8888/nubuilder/product ... db/mynewdb


kind regards

Michael
mklante
Posts: 14
Joined: Tue Sep 18, 2012 12:44 pm

Re: Installation and password problem

Unread post by mklante »

Sorry I saw you cannot see the entire url

localhost:8888/nubuilder/productionnu2/formlogin.php?x=1&d=db/qvnu.

??
mklante
Posts: 14
Joined: Tue Sep 18, 2012 12:44 pm

Re: Installation and password problem

Unread post by mklante »

You have solved the problem thank you very much!

kind regards

Michael
admin
Site Admin
Posts: 2791
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5
Been thanked: 4 times

Re: Installation and password problem

Unread post by admin »

.
Locked