uvdesk / community-skeleton

UVdesk Opensource Community Helpdesk Project built for all to make a Full Ticketing Support System along with many more other features.
https://www.uvdesk.com
MIT License
8.53k stars 459 forks source link

Fails to connect to database #204

Closed clayrisser closed 4 years ago

clayrisser commented 4 years ago

Description
Fails to connect to the database with the following error.

  Examining helpdesk setup for any configuration issues:

  [-] Establishing a connection with the database database.
  [x] Failed to establish a connection with the database database.

      Please ensure that you have correctly configured the DATABASE_URL variable defined inside your .env environment file.

  Exiting evaluation process.

How to reproduce
Run the database

docker run --name some-mysql --rm -e MYSQL_DATABASE=database -e MYSQL_ROOT_PASSWORD=pass -p 3306:3306 mariadb

Setup app

composer create-project uvdesk/community-skeleton helpdesk-project --stability dev

Use the following database connection string

DATABASE_URL=mysql://root:pass@127.0.0.1:3306/database

Run app

php bin/console uvdesk:configure-helpdesk
clayrisser commented 4 years ago

You can use phpmyadmin to verify it sets up the database correctly.

docker run -p 8080:80 --link some-mysql:db --rm phpmyadmin/phpmyadmin
ghost commented 4 years ago
Examining helpdesk setup for any configuration issues:

  [-] Establishing a connection with the database database.
  [v] Successfully established a connection with the database database.

  [-] Comparing the database database schema with the current mapping metadata.
  [!] The current database schema is not up-to-date with the current mapping metadata.

      Update your database schema to the current mapping metadata? [Y/N] y

      Please wait while your database is being migrated from version 20190919102810 to 20190919105208.
      This could take up to a few minutes.

There might be some kind of problem with your mysql connection. I was able to reporduce the same error, but on my end there was a problem with my mysql connection. After fixing that It worked fine. Did you checked you database connection before running the command?

clayrisser commented 4 years ago

Yes, I connected to the database using phpmyadmin

clayrisser commented 4 years ago

I'll try it without docker

vaishaliwebkul commented 4 years ago

Hi codejamninja, Have you tried it out without docker?

clayrisser commented 4 years ago

@vaishaliwebkul I haven't got around to it yet. I'll try it sometime this next week.