InvalidArgumentException: Database [database] not configured - php

I have deployed a web app to heroku and everything seemed to be okay. I ran the migration and it was successful.
When I try to open the app in a browser am getting the below error, what could be the problem? Having in mind the migration was successful and when I access the heroku DB from my localhost it is working well.
production.ERROR: InvalidArgumentException: Database [database]
not configured. in /app/bootstrap/cache/compiled.php:11774
Kindly help.

Related

lightsail unable to find database

i am new at AWS lightsail, basically just following the instruction step by step create a instance, create a database named mypost, and upload all file to instance by filezilla, and then use potty to connect phpmyadmin, export local database into online database, but somehow when i test the link on browser it tell me Connection Error: SQLSTATE[HY000] [1049] Unknown database 'mypost' , i checked both phpmyadmin and database in the aws console all named mypost, i also switched to public mode as well, anyone know why is it?

MySQL+Laravel: SQLSTATE[HY000] [1045] Access denied for user 'so'#'localhost' but connection data is OK and config cache is cleared

I need help here, because it's driving me crazy. I'm trying to connect to the remote production DB but I'm unable. I have read tons of posts about this that are focusing on the credentials and also running the following commands to clean config that are stored in Laravel cache:
php artisan cache:clear
php artisan config:cache
php artisan config:clear
Laravel 5 error SQLSTATE[HY000] [1045] Access denied for user 'homestead'#'localhost' (using password: YES)
Any of these are working for me.
I have checked very well the credentials both in my .env file and my database.php. I'm able to connect to a local database by using the ip "127.0.0.1" but I'm unable with the production DB stored in Google Cloud. It's good to mention that my local IP is allowed to access that Database and I'm able to connect by using MySql Workbench.
Here is what I see when I perform "php artisan tinker" and then "DB::connection()->getPdo();" to check my connection from terminal:
The only thing that calls my attention is the message containing "so#localhost" when I'm not performing a connection to localhost but I don't know if that's related with the issue.
Any other suggestion? I have lost too much time trying to find out what could be happening.
EDIT 1: Laravel Framework 5.8.38
After two days fighting with this one, I readed tons of posts and a lot of unuseful solutions I have found my solution by looking at this video.
Basically, you must stop you XAMPP MySQL Server and open C:\xampp\mysql\bin\my.ini and edit by adding the following command "skip-grant-tables" after the [mysqld] attribute. The result in this file might look this way:
# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables
socket="C:/xampp/mysql/mysql.sock"
...
After that, I ran "php artisan tinker" and DB::connection()->getPdo(); and everything was connected again, but it's good if you first clean your cache and config.

Laravel / Envoyer production error - Class view does not exist

I recently created a new production deployment for a new Laravel-based system. Initially, I had a few permissions issues with the storage folder that I resolved pretty easily. Once I resolved those, I had the app running correctly, but upon my next deployment (with Envoyer), I ran into a different issue that I haven't been able to pin down.
I'm now getting a fatal PHP error that I wasn't getting before:
PHP Fatal error: Uncaught ReflectionException: Class view does not
exist in
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php:719\nStack
trace:\n#0
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(719):
ReflectionClass->__construct('view')\n#1
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(598):
Illuminate\Container\Container->build('view')\n#2
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(567):
Illuminate\Container\Container->resolve('view')\n#3
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(708):
Illuminate\Container\Container->make('view')\n#4
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php(1139):
Illuminate\Foundation\Application->make('view')\n#5
/var/www/Core/releases/20170804125010/vendor/laravel/framewo in
/var/www/Core/releases/20170804125010/vendor/laravel/framework/src/Illuminate/Container/Container.php
on line 719
I've played around with various permissions, tried manually running composer install/update, npm install/etc. with no resolution. Any thoughts would be greatly appreciated.
After quite a bit of experimentation with no luck, I think I resolved it. The Ubuntu user that was set up for deployment with Envoyer was, by default, deploying everything with the 'envoyer' group permissions. This created a permissions conflict with the actual app permissions on Ubuntu. I updated the default group for the deploying user to 'www-data' and it seems that everything is cleared up now.

Upload Local Laravel Project to Server

I've created a Laravel 5.3 project on my local apache server(XAMPP) and it works fine with login and registration.
However, when I upload(via FTP) to my server(the server is 000webhosting) and try to do login it returns an error saying:
PDOException in Connector.php line 119:
SQLSTATE[HY000] [2002] Connection refused
I've already changed the .env to match the server DB's info, and just in case I also changed the config/database.php to also match. But it still appears like that?
Do you know exactly everything I have to change in my project so it can work on the server?
May be Your database password changed in live. update .env file

Getting laravel app Database running on local

Hey guys I'm new to PHP/Laravel, from a rails background. I pulled down an app via ssh that has certain database configurations and I cant for the life of me get this app running locally these are the errors I keep getting.
SQLSTATE[HY000] [1045] Access denied for user
'fatkikisManiak'#'localhost' (using password: YES)
For this error I noticed that it was trying to run the production configurations so I thought it best to change to a development config. I went into bootstrap/start.php and
$env = $app->detectEnvironment(array(
\\'local' => array('homestead', 'Username', 'password'),
'local' => array('MacBook-Pro'),
));
This gives me:
SQLSTATE[HY000] [1049] Unknown database 'fatkikis_local'
Any help on getting this resolved would be apprciated
Please check the .env file in the root folder and modify the database informations.
This is a hidden file.

Categories