1

(37 replies, posted in Installation)

Testing further i think i Just got the root of the problem, indeed there is something wrong with the file connect_db_mysqli.inc as gnurob mentioned, when you use a password on the user database that is 21 or more characters long this script fail in the setup, a password less than 21 character will connect successfully go to next steps and install the application.


I could prove that is the script failing and not the database, because i also test hardcoding the password  in the line 205 of the file connect_db_mysqli.inc, If you hardcode the password and run the setup no matter if  password is 21 o more characters long it will succeed.

I change this line

  $db = mysqli_connect($connection["host"], $connection["dbuser"], $connection["dbpassword"], "",
                !empty($connection["port"]) ? $connection["port"] : 3306); // default port in mysql is 3306

For this line

$db = mysqli_connect($connection["host"], $connection["dbuser"], "your_hard_code_pass_here", "",
                !empty($connection["port"]) ? $connection["port"] : 3306); // default port in mysql is 3306

So in conclusion:
- There is something wrong in the logic of the code on the file connect_db_mysqli.inc at line 205 (db_create_db function), that is not passing the correct password to the database if password is 21 characters or more.

Workaround:
- Use a password less than 21 characters for the database user.

Hope this is could help, and some of the developers can test, confirm and fix this issue

2

(37 replies, posted in Installation)

Thanks for the response but Is not the database, as you can see the MariaDB logs I pasted, there is a successful connection and the db running. as you can see on the logs i tried on the application install and fail (LOG 96) but using the same credentials i could access to the database correctly BY SSH and mysql client (LOG 97).  also installed a wordpress pointing to same database with same credential  for testing and no problem with database, also the account have all privileges

I tried the script kvvaradha posted so long ago to test the db connection and was success, also tried the solution of redcone, but it did not work. So do not have now where to look out, I will appreciate what else i could check out to get the problem solved.


201221  3:49:05     96 Connect  fraccdbuser@localhost as anonymous on fraccdb
                    96 Connect  Access denied for user 'fraccdbuser'@'localhost' (using password: YES)
201221  3:49:41     97 Connect  fraccdbuser@localhost as anonymous on
                    97 Query    select @@version_comment limit 1
201221  3:49:57     97 Query    SELECT DATABASE()
                    97 Init DB  fraccdb
                    97 Query    show databases
                    97 Query    show tables
201221  3:50:01     97 Quit

3

(37 replies, posted in Installation)

Also turn the logs ON and i could see the following, the first (96) connect is via the front accounting setup and the second (97) is via ssh by mysql client.

201221  3:49:05     96 Connect  fraccdbuser@localhost as anonymous on fraccdb
                    96 Connect  Access denied for user 'fraccdbuser'@'localhost' (using password: YES)
201221  3:49:41     97 Connect  fraccdbuser@localhost as anonymous on
                    97 Query    select @@version_comment limit 1
201221  3:49:57     97 Query    SELECT DATABASE()
                    97 Init DB  fraccdb
                    97 Query    show databases
                    97 Query    show tables
201221  3:50:01     97 Quit

4

(37 replies, posted in Installation)

Hello I having the same problem trying to install front accounting i get the errors
mysqli_connect(): (HY000/1045): Access denied for user 'fraccdbuser'@'localhost' (using password: YES) in file: /var/www/html/fracc/includes/db/connect_db_mysqli.inc at line 206
mysqli_select_db() expects parameter 1 to be mysqli, bool given in file: /var/www/html/fracc/includes/db/connect_db_mysqli.inc at line 208
mysqli_query() expects parameter 1 to be mysqli, bool given in file: /var/www/html/fracc/includes/db/connect_db_mysqli.inc at line 213
Cannot connect to database. User or password is invalid or you have no permitions to create database

I tested the connection script  apmuthu posted and i can successfully connect to the database with the credentials, also can connect with the credentials of fraccdbuse using ssh and use the database and create tables on it, also www-data have all privilege on the web root html folder.
Finally i tried to hardcode the database name  in the script as apmuthu but is the same errors occurs.

Using FrontAccounting 2.9

PHP Version 7.4.3

installed on Apache
Server version: Apache/2.4.41 (Ubuntu)
Server built:   2020-08-12T19:46:17

Using MariaDB database
Server version: 10.3.25-MariaDB-0ubuntu0.20.04.1 Ubuntu 20.04

Help appreciated