meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

Installation #2112

Open jberanek opened 6 years ago

jberanek commented 6 years ago

Hi There,

I am trying to configure the mrbs from scratch to be used for my schools ICT suites and iPad bookings.

When I run localhost/mrbs/web page I am getting the following error:

Uncaught exception 'MRBS\DBException' in C:\xampp\htdocs\mrbs\web\lib\MRBS\DB.php at line 75
SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)
SQL: 
Params: 
#0 C:\xampp\htdocs\mrbs\web\lib\MRBS\DBFactory.php(25): MRBS\DB->__construct('localhost', 'root', '12345', 'mrbs', false, 3306)
#1 C:\xampp\htdocs\mrbs\web\dbsys.inc(46): MRBS\DBFactory::create('mysql', 'localhost', 'root', '12345', 'mrbs', false, NULL)
#2 C:\xampp\htdocs\mrbs\web\dbsys.inc(96): MRBS\db()
#3 C:\xampp\htdocs\mrbs\web\defaultincludes.inc(30): require_once('C:\\xampp\\htdocs...')
#4 C:\xampp\htdocs\mrbs\web\index.php(9): require('C:\\xampp\\htdocs...')
#5 {main}
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array

Apologises for the bigger text. Any help would be greatly appreciated :)

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1401

jberanek commented 6 years ago

Either your MySQL username and password are incorrect, or that database user does not have sufficient rights.

You can get rid of the big text by using the Markdown. See the ? symbol for details. I've fixed the big text above.

Original comment by: campbell-m

jberanek commented 6 years ago

Hi Campbell,

Thanks for the quick responce.

Where would I check this? Is it in config.php?

Original comment by: *anonymous

jberanek commented 6 years ago

Yes, you need to enter the database username details into config.inc.php.

Original comment by: campbell-m

jberanek commented 6 years ago

Can you give me an examlpe of this would look within the config file?

Thanks

Original comment by: *anonymous

jberanek commented 6 years ago

See the config.inc.php file for details. It would look like this:

/*******************
 * Database settings
 ******************/
// Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL
$dbsys = "mysql";
// Hostname of database server. For pgsql, can use "" instead of localhost
// to use Unix Domain Sockets instead of TCP/IP. For mysql "localhost"
// tells the system to use Unix Domain Sockets, and $db_port will be ignored;
// if you want to force TCP connection you can use "127.0.0.1".
$db_host = "localhost";
// If you need to use a non standard port for the database connection you
// can uncomment the following line and specify the port number
// $db_port = 1234;
// Database name:
$db_database = "mrbs";
// Schema name.  This only applies to PostgreSQL and is only necessary if you have more
// than one schema in your database and also you are using the same MRBS table names in
// multiple schemas.
//$db_schema = "public";
// Database login user name:
$db_login = "mrbs";
// Database login password:
$db_password = 'mrbs-password';
// Prefix for table names.  This will allow multiple installations where only
// one database is available
$db_tbl_prefix = "mrbs_";
// Set $db_persist to TRUE to use PHP persistent (pooled) database connections.  Note
// that persistent connections are not recommended unless your system suffers significant
// performance problems without them.   They can cause problems with transactions and
// locks (see http://php.net/manual/en/features.persistent-connections.php) and although
// MRBS tries to avoid those problems, it is generally better not to use persistent
// connections if you can.
$db_persist = FALSE;

At the very least you will need to set the values for $db_database, $db_login and $db_password.

Original comment by: campbell-m

jberanek commented 6 years ago

So in PHPMyAdmin I have named my database "mrbs"

Would the value for this then be: $db_database ="mrbs"

And If I wanted to created a user called "admin" with the password "12345" would I have to created these fields within the mrbs_users table as well as define it in the config.inc.php?

Original comment by: *anonymous

jberanek commented 6 years ago

Yes, set

$db_database ="mrbs";

You will also need to set the values of $db_login and $db_password to be the username and password of a database (not MRBS) user. If you've set those correctly you should then be able to launch MRBS in a browser. The first time you do that click on the "User list" link in the top right hand corner. You will then be invited to create your first MRBS user, which will automatically have admin rights. Then login with the details you have just created and crreate more users ans areas and rooms. Note that you should not create MRBS users using phpMyAdmin.

Original comment by: campbell-m

jberanek commented 6 years ago

... so if you have already created some MRBS users in the users table using phpMyAdmin then delete them before you do anything else.

Original comment by: campbell-m

jberanek commented 6 years ago

Hello,

I also get the same error but it works perfect in local system.

Below is my config files -

<?php // -*-mode: PHP; coding:utf-8;-*-
namespace MRBS;

/**************************************************************************
 *   MRBS Configuration File
 *   Configure this file for your site.
 *   You shouldn't have to modify anything outside this file.
 *
 *   This file has already been populated with the minimum set of configuration
 *   variables that you will need to change to get your system up and running.
 *   If you want to change any of the other settings in systemdefaults.inc.php
 *   or areadefaults.inc.php, then copy the relevant lines into this file
 *   and edit them here.   This file will override the default settings and
 *   when you upgrade to a new version of MRBS the config file is preserved.
 **************************************************************************/

/**********
 * Timezone
 **********/

// The timezone your meeting rooms run in. It is especially important
// to set this if you're using PHP 5 on Linux. In this configuration
// if you don't, meetings in a different DST than you are currently
// in are offset by the DST offset incorrectly.
//
// Note that timezones can be set on a per-area basis, so strictly speaking this
// setting should be in areadefaults.inc.php, but as it is so important to set
// the right timezone it is included here.
//
// When upgrading an existing installation, this should be set to the
// timezone the web server runs in.  See the INSTALL document for more information.
//
// A list of valid timezones can be found at http://php.net/manual/timezones.php
// The following line must be uncommented by removing the '//' at the beginning
$timezone = "Asia/Kolkata";

/*******************
 * Database settings
 ******************/
// Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL
$dbsys = "mysql";
// Hostname of database server. For pgsql, can use "" instead of localhost
// to use Unix Domain Sockets instead of TCP/IP. For mysql "localhost"
// tells the system to use Unix Domain Sockets, and $db_port will be ignored;
// if you want to force TCP connection you can use "127.0.0.1".
$db_host = "localhost";
// If you need to use a non standard port for the database connection you
// can uncomment the following line and specify the port number
// $db_port = 1234;
// Database name:
$db_database = "mrbs";
// Schema name.  This only applies to PostgreSQL and is only necessary if you have more
// than one schema in your database and also you are using the same MRBS table names in
// multiple schemas.
//$db_schema = "public";
// Database login user name:
$db_login = "mrbs";
// Database login password:
$db_password = 'mrbs@1234';
// Prefix for table names.  This will allow multiple installations where only
// one database is available
$db_tbl_prefix = "mrbs_";
// Set $db_persist to TRUE to use PHP persistent (pooled) database connections.  Note
// that persistent connections are not recommended unless your system suffers significant
// performance problems without them.   They can cause problems with transactions and
// locks (see http://php.net/manual/en/features.persistent-connections.php) and although
// MRBS tries to avoid those problems, it is generally better not to use persistent
// connections if you can.
$db_persist = FALSE;

/* Add lines from systemdefaults.inc.php and areadefaults.inc.php below here
   to change the default configuration. Do _NOT_ modify systemdefaults.inc.php
   or areadefaults.inc.php.  */

Kindly help

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ce719b68/b104/attachment/mrbs.JPG

jberanek commented 6 years ago

Well it's actually a different error message. Try changing $db_host from 'localhost' to '127.0.0.1'. See this answer on stackoverflow.

By the way, if that's your real password I would change it now that it has been made public.

Original comment by: campbell-m

jberanek commented 6 years ago

My humble thanks, this worked after changing to 127.0.0.1. Thanks many!!!

Original comment by: *anonymous

jberanek commented 5 years ago
Uncaught exception 'MRBS\DBException' in C:\xampp\htdocs\mrbs\web\lib\MRBS\DB.php at line 75
SQLSTATE[HY000] [1045] Access denied for user 'admin'@'localhost' (using password: YES)
SQL: 
Params: 
#0 C:\xampp\htdocs\mrbs\web\lib\MRBS\DBFactory.php(25): MRBS\DB->__construct('localhost', 'admin', 'admin@sse', 'mrbs', false, 3306)
#1 C:\xampp\htdocs\mrbs\web\dbsys.inc(46): MRBS\DBFactory::create('mysql', 'localhost', 'admin', 'admin@sse', 'mrbs', false, NULL)
#2 C:\xampp\htdocs\mrbs\web\dbsys.inc(96): MRBS\db()
#3 C:\xampp\htdocs\mrbs\web\defaultincludes.inc(30): require_once('C:\\xampp\\htdocs...')
#4 C:\xampp\htdocs\mrbs\web\index.php(9): require('C:\\xampp\\htdocs...')
#5 {main}
MRBS GET: Array
(
)
MRBS POST: Array
(
)
MRBS SESSION: Array
(
)

Original comment by: *anonymous

jberanek commented 5 years ago

Sir i am getting this error plz help me to slove this problem

Original comment by: *anonymous

jberanek commented 5 years ago

Either the database user details are incorrect or the user doesn't have access rights for that database.

Original comment by: campbell-m

jberanek commented 4 years ago

Hi @cambell morrison I have see youtube video tutorial, install documents, read a lot of your post, included this one. I've the same problem (I guess) with the database (this time, i recently try 2 times in macos and now in windows). I set properly the config.inc.php and phpmyadmin, but i'm stuck here. Can you help me? Thanks for all of your posts.

Original comment by: *anonymous

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ce719b68/10e3/attachment/errorcode.txt

jberanek commented 4 years ago

Sorry for the anonymous message, i didn't log. I send also my config.inc

Original comment by: antimarck

Attachments: https://sourceforge.net/p/mrbs/support-requests/_discuss/thread/ce719b68/a020/attachment/config.inc.php

jberanek commented 4 years ago

Have you tried using 127.0.0.1 instead of localhost?

Original comment by: campbell-m

jberanek commented 4 years ago

Yes Sir. But report the same error (just localhost changed in 127.0.0.1) And also, I can't connect another pc with another connection. (I tried "IP Adress/mrbs/web) ("all granted" already change) Thank you so much for your help!

Original comment by: antimarck

jberanek commented 4 years ago

Yes Sir. But report the same error (just localhost changed in 127.0.0.1) And also, I can't connect another pc with another connection. (I tried "IP Adress/mrbs/web) ("all granted" already change) Thank you so much for your help!

Original comment by: antimarck

jberanek commented 4 years ago

Are you using a MariaDB or MySQL?

Original comment by: campbell-m

jberanek commented 4 years ago

If you are using MariaDB try

$db_port = 3308;

See https://sourceforge.net/p/mrbs/support-requests/1523/.

Original comment by: campbell-m

jberanek commented 4 years ago

When I try to connect "Navicat db", i use Mysql, but when the database is connected on the right appear: "server Version: 10.4.11-MariaDB" so it means i'm using maria?. I try 3308 in config.inc but never change. In Navicat just dosen't connect.

edit: I see now in phpmyadmin: "Mariadb" I need to change? edit2: I see your link, i check also the name of user (root) host (localhost) global ALL PRIVILEGES Yes.

Original comment by: antimarck

jberanek commented 4 years ago

I know it's a silly question, but I assume the database name, username and password are all correct in your config file?

If so, then try

$db_port = 3308;

and also

$db_port = 3308;
$db_host = "127.0.0.1";

Original comment by: campbell-m

jberanek commented 4 years ago

E_DEPRECATED in C:\xampp\htdocs\mrbs\web\functions.inc at line 801

How can i solve this error, please help me someone!

Original comment by: *anonymous

jberanek commented 4 years ago

Which version of MRBS are you running?

Original comment by: campbell-m

jberanek commented 1 year ago

install ok but userlist not showing. why

Original comment by: *anonymous

jberanek commented 1 year ago

The user list only shows when $auth['type'] is set to 'db'.

Original comment by: campbell-m