Solved UVDesk Installer Error: "Details are incorrect ! Connection not established."
-
Hello. Thank you for reviewing my post and I look forward to any assistance as I have really enjoyed the look and feel of UVDesk during the live demo.
Problem: When using the web installer, in the Database Configuration step, I specify my details for connecting to the database (MySQL) and despite trying different things, I cannot get past the error at the bottom, "Details are incorrect ! Connection not established.".
My environment:
- Windows Server 2016 (14393.5648)
- Apache 2.4.54 x64
- MySQL 8.0.32 MySQL Community Server - GPL
- PHP 7.4.33
- UVDesk - using manual zip file: uvdesk-community-v1.1.1.zip
- Browser: Chrome v111.0.5563.65
Prior Research:
I did attempt some Google-fu before making this post for assistance and unfortunately the advice provided here, https://forums.uvdesk.com/topic/2068/uvdesk-community-cannot-connect-to-database did not assist with my particular issue, which addressed disabling redis. I'm not using redis and also went a step further and commented out the code in Setup.php around line 245My Form Entries:
- Server: 127.0.0.1 (also tried localhost)
- Port: 3306
- Username: root
- Password: Tried two different ones, last attempt using 7 character password with one uppercase, 3 numbers, and 3 lowercase letters in case prior password was too crazy.
- Database: UVDesk
- Unchecked and Checked - Automatically create database if not found?
Troubleshooting Performed:
-
Success - MySQL 8 shell able to log in with root @ localhost on 3306
-
Success - Used PHPMyAdmin to also log in successfully.
-
Unsuccessful - Thought maybe not having a DB previously configured might be causing any issues despite the installer saying it could make it for me. Used the shell to create "UVDesk" database. Tried in the installer with the name, "UVDesk", no change.
-
Unsuccessful - My root MySQL password was something pretty long.. 4-5 word passphrase, changed to just a 7 character password to test with, one uppercase, 3 numbers, rest lowercase. No special characters.
-
Successful - Verified with Chrome's network tools that the information being passed is correct and matched what I typed into the form.
Unsuccessful - Apache conf updated to include Allow Override and Apache restarted:
<Directory "C:\Apache24\htdocs"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
No Change: My .env file with UVDesk was already set to APP_ENV=dev
Closing
I appreciate any and all assistance sent my way. Thank you for reading through my post. I hope you have a most wonderful day. -
Please try to use the username and password that you assigned to the "UVDesk" database when you created it.
My Form Entries:
Server: 127.0.0.1 (also tried localhost)
Port: 3306
Username: root | use the username for accessing the "UVDesk" database
Password: Tried two different ones, last attempt using 7 character password with one uppercase, 3 numbers, and 3 lowercase letters in case prior password was too crazy. | use the password for accessing the "UVDesk" database
Database: UVDesk
Unchecked and Checked - Automatically create database if not found? -
@blckhwk
Thank you for taking the time to reply. I tried your suggestion and am still presented with the same error message.Here's what I did so you can review:
- Logged in with PHPMyAdmin.
- Dropped/deleted my existing database: uvdesk
- Created a new user (uvdesk), password (14 letters and 1 number), and allowed access from any host.
- Enabled the checkbox to create a DB with the same username with all privileges....SQL executed successfully.
- Confirmed 'uvdesk' DB name shows up on the left side tree.
- Confirmed 'uvdesk' user account is listed under the DB on the Privileges tab.
Columns: Username, Host name, type, privileges
Row 1: uvdesk, %, database-specific, all-privileges.
Opened the UVDesk installer and went back to the same form and entered the following:
- Server: 127.0.0.1
- Port: 3306
- Username: uvdesk
- Password: (15 character alphanumeric password entered, no special chars used)
- Database: uvdesk
- Tried with and without the checkbox to: Automatically create database if not found?
Still receive error: Details are incorrect ! Connection not established.
-
Still receive error: Details are incorrect ! Connection not established.
Can you please share your log file from your project. Please follow the below path for log file:
your-project-folder-name/var/log/dev.log
-
@Komal-Sharma https://pastebin.com/H2Y6y8j2 is the log file for the most recent attempt using the installer.
Thank you
-
Can you please share you composer.json and composer.lock file.
Also, share your .env file with your setup details.I've attached a code that will help us in debugging the database connection issues. Please copy and paste it to the ./src/Console/ directory relative to the project and then run the following command from the terminal:
php bin/console uvdesk:test:validate-database-credentials;
This command will use the currently available credentials and establish a connection with your database server. In case of issue, it will output the used credentials that you can cross-verify to ensure they are valid. In case the credentials are valid, then in order to proceed further and resolve this issue, we will need you to either provide us with temporary access to your server where the project is hosted, or share with us temporary access credentials to your database server that we can use to debug any connection related issues in the project at our end locally.
<?php namespace App\Console; use Doctrine\DBAL\DBALException; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Dotenv\Dotenv; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; class ValidateDatabaseCredentials extends Command { public function __construct(ContainerInterface $container, EntityManagerInterface $entityManager) { $this->container = $container; $this->entityManager = $entityManager; parent::__construct(); } protected function configure() { $this ->setName('uvdesk:test:validate-database-credentials') ->setDescription('Review database connection parameters and report and issues encountered while establishing a connection with database.') ; } protected function execute(InputInterface $input, OutputInterface $output) { if ('dev' != $this->container->get('kernel')->getEnvironment()) { throw new \Exception("\nThis command is only allowed to be used in development environment.", 500); } if (false == $this->isDatabaseConfigurationValid()) { $connection = $this->entityManager->getConnection(); $database = $connection->getDatabase(); $output->writeln("\n<comment>Unable to establish a connection with database. Please review the credentials in .env(.local) configuration files accordingly.</comment>\n"); $helper = $this->getHelper('question'); $question = new ConfirmationQuestion('Display database connection credentials?', false); if (!$helper->ask($input, $output, $question)) { $params = $connection->getParams(); $output ->writeln([ "", "Connection URL:\t\t{$params['url']}", "Database Name:\t\t{$params['dbname']}", "Database Driver:\t{$params['driver']}", "Host:\t\t\t{$params['host']}", "Port:\t\t\t{$params['port']}", "User:\t\t\t{$params['user']}", "Password:\t\t{$params['password']}", "Server Version:\t\t{$params['serverVersion']}", "", ]) ; $output->writeln([ "Please review and ensure that these database credentials are valid before proceeding.", "In case the credentials are correct, please ensure that your database is not behind a firewall that could be interfering while trying to establish a connection.", "", ]); } return Command::SUCCESS; } $database = $this->entityManager->getConnection()->getDatabase(); $output->writeln("\nNo issues found establishing a connection with database <info>$database</info>.\n"); return Command::SUCCESS; } private function isDatabaseConfigurationValid() { $databaseConnection = $this->entityManager->getConnection(); if (false === $databaseConnection->isConnected()) { try { $databaseConnection->connect(); } catch (DBALException $e) { // dump($e); return false; } } return true; } }
-
Hello,
I had the same problem, but figured it out, so you just need to change server, not to 127.0.0.1 or localhost but to the local ip of the computer that is hosting database, for example 192.168.x.xIf the computer with database is the same as installation, you just enter local ip address of the computer/server.
Hope that helps,
Grilc L -
peopleinside