-2
I recently created a Previder service, which kind of works.
however when I will capture the database data using Produtos::all();
I get the following error:
Database name seems incorrect You’re using the default database name Laravel. This database does not exist.
Edit the . env file and use the correct database name in the DB_DATABASE key.
the data in the ENV file:
DB_CONNECTION=mysql
DB_HOST=tommy.heliohost.org
DB_PORT=3306
DB_DATABASE=ricmlima_site
DB_USERNAME=ricmlima
DB_PASSWORD=*******
/config/database.php
'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [ 'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
I have already tried to remove the default data in the /config/database.php file
'host' => env('DB_HOST', 'tommy.heliohost.org'),
'database' => env('DB_DATABASE', 'ricmlima_site'),
'username' => env('DB_USERNAME', 'ricmlima'),
'password' => env('DB_PASSWORD', '********'),
But you didn’t solve it. what I do ?
Have you tried switching the host to
localhost
rather thantommy.heliohost.org
? Since the application is hosted on that server will probably work like this.– Laércio Lopes
:D I have the application running locally. with external database. @Laérciolopes . However, I just solved it. Redoing the Laravel cache. Thank you very much.
– Risk