Error - Check DB connection: [06] Error:

TGSTech

Member
Check DB connection: [06] Error: during database connection. Please check $host, $user, $pass and $db_name in config.php (actually config_custom.php). Also, and i think these are related;
SQLSTATE[HY000] [1045] Access denied for user 'silvia'@'localhost' (using password: YES) There is a connection problem, check $host, $user, $pass, $db_name, $db_schema.

config parameters ...
$dbms_type = 'mysql';
$host = 'dadabikfldr'; .. a virtual host.
$db_name = 'ColAbstractDB.xlsx';
$user = 'silvia';
$pass = 'X'; .. replaced password with X.
//$db_schema=

I am at a loss as to what the problem is.
Why is the error msg referring 'silvia'@'localhost' when host parameter points to the virtual host?
What is wrong with the parameter values?
Host name is copied from the server to ensure spelling is correct.
The db_name does not exist yet cause i don't know where to put it.
Appears that dadabik does not support virtual hosts.
The connection problem suggests to me that it's looking for the db in a specific location. Where?

Many Thanks for your help!!!!

Server Configuration​

Apache Version:2.4.58 - Documentation ApacheServer Software:Apache/2.4.58 (Win64) PHP/8.2.13 mod_fcgid/2.3.10-dev - Port defined for Apache: 80PHP Version:[Apache module] 8.2.13 - Documentation PHP - Loaded PHP extensions - Use of PHP versions [FCGI] 7.4.33 - 8.0.30 - 8.1.26 - 8.2.13 - 8.3.0 - FCGI mode helpMySQL Version:8.2.0 - Port defined for MySQL: 3306 - default DBMS - Documentation MySQLMariaDB Version:11.2.2 - Port defined for MariaDB: 3307 - Documentation MariaDB - MySQL - MariaDB
 

deep64blue

DaDaBIK Guru
The first thing to do is to check the connectivity outside of dadabik using a tool like MySQL Workbench or the command line. You will need to have the database created for this.

Once you have established the connection is working correctly you can try from PHP with this script, save it as say test.php in the document root of your virtual server:-

PHP:
<?php

$host = 'dadabikfldr';
$db = 'dbname';   
$user = 'silvia';
$password = 'password';

$dsn = "mysql:host=$host;dbname=$db;charset=UTF8";

try {
    $pdo = new PDO($dsn, $user, $password);

    if ($pdo) {
        echo "Connected to the $db database successfully!";
    }
} catch (PDOException $e) {
    echo $e->getMessage();
}

?>

When you connect to it it will either confirm connection or give you an error message.
 

deep64blue

DaDaBIK Guru
Why is the error msg referring 'silvia'@'localhost' when host parameter points to the virtual host?

The db_name does not exist yet cause i don't know where to put it.
You can't connect to a database that doesn't exist, the system is probably failing using your hostname and then checking localhost.

ColAbstractDB.xlsx looks like an Excel file, if you're trying to use that to set up Dadabik you will need to create an empty database first.
 

TGSTech

Member
I have 36 years experience with numerous languages plus off and on after i retired 11 years ago but i have never had to use these tools and i'm feeling very inept right now. I am sorry i'm so needy.
Downloaded the workbench and now trying to do the verification. Installed md5 and the checksum doesn't match. Trying to use Gnupg and i'm lost. Have no idea how to make this work. tried the decrypt/verify that failed. How do i verify the integrity of this workbench file with GNUpg? Where do i get a file that's not compromised?
 

TGSTech

Member
See attached for command line tools result.

I have created an sql database and placed in dadabikfldr/apps. Is that the right place?

Ran your connection test" SQLSTATE[HY000] [1045] Access denied for user 'silvia'@'localhost' (using password: YES)
This essentially the same error as when trying to install. Access denied ....
<?php

$host = 'dadabikfidr';
$db = 'ColAbstractDB.sql';
$user = 'silvia';
$password = 'X'; replaced password with X.

$dsn = "mysql:host=$host;dbname=$db;charset=UTF8";

try {
$pdo = new PDO($dsn, $user, $password);

if ($pdo) {
echo "Connected to the $db database successfully!";
}
} catch (PDOException $e) {
echo $e->getMessage();
}

?>
 

Attachments

  • Command line tools web page.jpg
    Command line tools web page.jpg
    173.3 KB · Views: 2

TGSTech

Member
I apologize up front for the length of this posting. I am really grabbing at straws causing me to ramble.
Have to tell you i had no idea installing dadabik was going to be so complicated. The install instructions lead you to believe does this then this then this and your done. Could not be further from the truth.

I used sqlizer.io to create the database. It didn't build in any security info in the database. The sql log below, InnoDB reference in the log suggests it's looking for security cluster. Could this be the issue?

It's not finding what it needs in the virtual host 'dadabikfldr' i provided. What is it looking for?

As i am sure you know, $user is defined as;
DATABASE USER
// create and drop permissions are also needed for installation, upgrade and administration
// area e.g. 'root'; for SQLite this parameter is not needed
// for better security, you should choose a user who has privileges ONLY on the database
// used by this application ($db_name parameter)
// this user MUST HAVE select, insert, update, delete permissions,
$user='root'
I don't understand what to put in here nor what it maps back to. If Windows permissions, I tried several windows permissions, all gave me the same message "SQLSTATE[HY000] [1045] Access denied for user 'silvia'@'localhost' (using password: YES)" localhost ini does have silvia in it. I used silvia because that is what the dadabik instructions say. It doesn't appear to work.

Due to the following partial statements, i'm thinking there is a permissions issue somewhere.
"... Check DB connection: [06] Error: during database connection. ..."
"SQLSTATE[HY000] [1045] Access denied for user 'silvia'@'localhost' (using password: YES) There is a connection problem...."

I looked at the sql log. I removed the date and time prefix stuff.

0 [System] [MY-015015] [Server] MySQL Server - start.
0 [System] [MY-010116] [Server] c:\wamp64\bin\mysql\mysql8.2.0\bin\mysqld.exe (mysqld 8.2.0) starting as process 20612
1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
0 [System] [MY-010931] [Server] c:\wamp64\bin\mysql\mysql8.2.0\bin\mysqld.exe: ready for connections. Version: '8.2.0' socket: '' port: 3306 MySQL Community Server - GPL.
9 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
10 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
11 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'
0 [System] [MY-013105] [Server] c:\wamp64\bin\mysql\mysql8.2.0\bin\mysqld.exe: Normal shutdown.
0 [System] [MY-010910] [Server] c:\wamp64\bin\mysql\mysql8.2.0\bin\mysqld.exe: Shutdown complete (mysqld 8.2.0) MySQL Community Server - GPL.
0 [System] [MY-015016] [Server] MySQL Server - end.

I looked for sha256_password. Could not locate it. I assume it's related to mysql.
 

deep64blue

DaDaBIK Guru
Have to tell you i had no idea installing dadabik was going to be so complicated. The install instructions lead you to believe does this then this then this and your done. Could not be further from the truth.
Dadabik is quite straightforward to install, what you have posted is not really a Dadabik issue it's a database issue.

I used sqlizer.io to create the database. It didn't build in any security info in the database.
As far as I can see this app generates a script that can create a database it doesn't actually create the database. It looks like you have MySQL installed so that's good - in your menu you should have an icon for something like "MySQL Command Line Client", if you run that then try these commands and tell us the results please:-

Code:
SHOW DATABASES;
SELECT user FROM mysql.user;
 

deep64blue

DaDaBIK Guru
OK thanks - this tells us you haven't created your database yet!

The undernoted code will create a new user and associated database (change the password 'changeme' to one of your choice!) then report on the details. Please run it and report back.

Code:
CREATE USER 'dadabik'@'%' IDENTIFIED WITH caching_sha2_password BY 'changeme';
GRANT USAGE ON *.* TO 'dadabik'@'%';
ALTER USER 'dadabik'@'%' REQUIRE NONE WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
CREATE DATABASE IF NOT EXISTS `dadabik`;
GRANT ALL PRIVILEGES ON `dadabik`.* TO 'dadabik'@'%';
SHOW DATABASES;
SELECT user FROM mysql.user;
 

deep64blue

DaDaBIK Guru
Sorry no, we're not at the stage of running PHP yet these are MySQL commands to get your database setup.

You run these commands in the MySQL Commnd Client like you did in post #9.
 
Last edited:

deep64blue

DaDaBIK Guru
Once you have successfully set up the database you can test the PHP connection with this script:-

PHP:
<?php

$host = 'dadabikfldr';
$db = 'dadabik';   
$user = 'dadabik';
$password = '*****';

$dsn = "mysql:host=$host;dbname=$db;charset=UTF8";

try {
    $pdo = new PDO($dsn, $user, $password);

    if ($pdo) {
        echo "Connected to the $db database successfully!";
    }
} catch (PDOException $e) {
    echo $e->getMessage();
}

?>
 

TGSTech

Member
Wow! It worked, database is created and connected!! Connected to the dadabik database successfully!
So, i ran the install and Success again! Finally progress thanks to you. Many Many Thanks!!!!

So my project database is dadabik. Can i change the db name or do i have to do the create and reinstall procedure again?
Can i move the database?

Many Thanks!!
 

TGSTech

Member
What happens if i successfully create a user, say "George" but get an error message on the grant line? Do i have to expunge user George or can i skip the create user commands and start with the grant line?
 

TGSTech

Member
To make sure i could replicate this success, i changed user to tgstechnician and db to tgstestsqldb and gave it new password.
Create command line resulted in:
create user tgstechncian = Success, user grant command – SUCCESS, alter command - SUCCESS, grant privileges FAILED so DB was not created. (i had put the user name in places rather than dbname and user. ) User is created!!
Gave sql console this username and password and it worked. Proof positive the username is valid.

2nd attempt - with user as tgstechnician and db to tgsqldb and used same password as first time. Results:
create user tgstechnician FAILURE (expected this), user grant command SUCCESS, alter command SUCCESS, create DB command SUCCESS. DB WAS CREATED!!
At this point, user and DB are created.

Ran connection test on the second attempt.
$host = 'dadabikfldr';
$db = 'tgsqldb';
$user = 'tgstechnician';
$password = '*****';
Result:
SQLSTATE[HY000] [1044] Access denied for user 'tgstechnician'@'%' to database 'tgsqldb' Had success on all the parts so why? How do i fix this?

Looks like sql server keeps the successful user names because user name was a success on first attempt failed on second.

Tried to just execute the create database and privileges: result, Why aren't the last 3 commands executing?
1708566740526.png
 

deep64blue

DaDaBIK Guru
Looks like sql server keeps the successful user names because user name was a success on first attempt failed on second.
Yes, these will rename until you delete them.

Glad you are making progress.

As you have made a lot of changes you might need to reset MySQL, try these commands and paste the results here:-

FLUSH PRIVILEGES;
SHOW DATABASES;
SELECT user FROM mysql.user;
SHOW GRANTS FOR tgstechnician;

Then try your connection test again.
 

TGSTech

Member
Yes progress feels good. Thank you.
Results from commands in response number 17.
1708633631605.png
1708633772653.png Think this all looks good.
The connection test is failing, access denied. Discovered the grant all privileges command did not work in sql console.
Tried entering just that command but console is not executing it. I am stumped again. Double checked the grant line, appears correct to me. Any ideas?
1708637395287.png
 

Attachments

  • 1708639734301.png
    1708639734301.png
    73 KB · Views: 0

TGSTech

Member
command lines not executing, not stumped anymore, had to restart the server.
As stated above, connection not working and think it's because user doesn't have any privileges.
Am stumped with this. fyi, mysql ver 8.2.0
1708645923318.png
1708645561528.png
your grant statement worked with dadabik in both username position and db position. I have tried many different combinations. copied from manuals, syntax errors every time. Any ideas???
I am logged into the console with 'root' so i have all the privileges.
 

TGSTech

Member
Wanting to install Oracle's mysql server. Will that conflict with dadabik? Can i use db created with oracle's mysql in dadabik? Planning on using MS Visual Studio Code and a workbench for sql. The workbench downloads all fail the checksum tests. Thanks for taking these questions as well.
 
Top