In my local laravel environment I don't have any problems connecting.
But in production I'm getting this:
return "SQLSTATE[08006] [7] timeout expired (SQL: select * from "document")" in all routes that queries the bank..
DB_CONNECTION=pgsql
DB_HOST=**.**.**.**
DB_PORT=5432
DB_DATABASE=***********
DB_USERNAME=************
DB_PASSWORD=***************
Problem was in the cache, noticed the password change for an incorrect one and I clicked the new one again and gave p
php artisan config:cache
started working again
Related
I am a beginner programmer and use Laravel with XAMPP on Mac. And all my attempts to create migrations lead to Query Error:
Illuminate\Database\QueryException
SQLSTATE[HY000] [2006] MySQL server has gone away (SQL: select * from information_schema.tables where table_schema = laravel-app and table_name = migrations and table_type = 'BASE TABLE')
My PHP version is 7.3.29 on MacBook
In XAMPP web-server: Apache/2.4.48 (Unix) OpenSSL/1.1.1k PHP/8.0.10 mod_perl/2.0.11 Perl/v5.32.1
What steps should i take to customize the request?
This is not a Laravel issue, but a general MySQL Issue. Maybe the server is not running. Are you sure you're running MySQL in the background?
Check this link: MySQL Gone Away
Do the following checks in your system:
The Database Engine is running
You have created your database
You have created an user and granted permissions to the database
You have setup the user and the database in your Laravel's .env file.
After this, try to run the migrations command again, which is:
php artisan migrate
As explained Here
I'm in Laravel 5.8 don't know why I kept getting this error while loggin in
SQLSTATE[08006] [7] authentication method 10 not supported (SQL: select * from "users" where "uuid" = ****** limit 1)
I've tried various version of PostgresSQL from this link.
14
I started off with psql version 14.
Try logging in... error started to happen.
13
I uninstalled 14 and installed 13. Try again... error still persists.
9.6
I've tried uninstalling 13 and installed 9.6, and Try again... error still persists.
Each time, I downgrade my postgres version, I had to recreate the database and restore from a backup .sql file.
psql -U postgres -d dbname < dbname.sql
Is this something wrong with my Laravel/PHP/Postgres config that leads to this ?
I'm running out of ideas now ... 😢
pg_hba.conf
I couldn't find the file.
beta#Betas-MacBook-Pro boss-portal % psql -U postgres
Password for user postgres:
psql (9.6.24)
Type "help" for help.
postgres=#
postgres=#
postgres=# SHOW hba_file;
hba_file
------------------------------------------
/Library/PostgreSQL/9.6/data/pg_hba.conf
I went to check
/Library/PostgreSQL/9.6/data/pg_hba.conf
It's not there.
This question already has answers here:
MySQL connection not working: 2002 No such file or directory
(23 answers)
Mysql localhost != 127.0.0.1?
(4 answers)
Closed 2 years ago.
homestead version: 9.2.0
vagrant version: 2.2.7
php version: 7.2.21
mysql version: 8.0.18
I created a new laravel project. I created a database called tickets. I've added the third party code from https://github.com/creativetimofficial/material-dashboard-laravel. When I get to step where you run "php artisan migrate --seed" I'm getting two different errors depedning on how I set db port in .env file.
Here's a picture of my db users and their hosts.
when DB_HOST=127.0.0.1 and I run the artisan migrate I get an error saying Connection refused. I only tried using 127.0.0.1 because I saw online people saying to use this instead of localhost. Since the connection is refused I have a feeling this isn't correct.
When DB_HOST=localhost and I run artisan migrate I get an error saying
No such file or directory (SQL: select * from information_schema.tables where table_schema = tickets and table_name = migrations and table_type = 'BASE TABLE') {"exception":"[object] (Illuminate\\Database\\QueryException(code: 2002): SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = tickets and table_name = migrations and table_type = 'BASE TABLE') at /Applications/MAMP/htdocs/ticket-dashboard/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669)
Questions:
1) should I be using the IP instead of localhost and if so why do I get connection refused with using the IP?
2) If using localhost is fine, what needs to be fixed to bypass this error?
I've been testing everything I can find online to help, but this is the closest I've gotten. Any advice or ideas would be greatly appreciated
I want to connect Laravel with Postgresql database
when I run
php artisan migrate
I get this error
SQLSTATE[08006] [7] timeout expired (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations)
my .env
DB_CONNECTION=pgsql
DB_HOST=projects.cggts***.rds.amazonaws.com
DB_PORT=5432
DB_DATABASE=projects
DB_USERNAME=*********
DB_PASSWORD=*********
It'll probably inbound VPC problem on AWS . You have to update IP range for your RDS db. You'll find it under EC2->Network & Security->Security Groups . Have fun ;)
I have the most basic setup in AWS:
a publicly accessible RDS instance (PostgreSQL 9.6.6 - same as my development one)
a CodeBuild project
both in the default VPC.
My application is written in Laravel 5.5 and the buildspec.yml runs ./artisan migrate --force at some point and CodeBuild outputs the following error:
[Container] 2018/03/10 19:41:36 Running command php artisan migrate --force
[Illuminate\Database\QueryException]
SQLSTATE[08006] [7] timeout expired (SQL: select * from information_schema.
tables where table_schema = public and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[08006] [7] timeout expired
[PDOException]
SQLSTATE[08006] [7] timeout expired
Where should I start looking for an error?
You need to make sure that the RDS security group allows inbound traffic from Code Build.
Go to https://ip-ranges.amazonaws.com/ip-ranges.json
Search for CODEBUILD and choose your region.
Add the IP to the inbound rule in the RDS Security Groups.
Create a Security Group for Code Build and reference it as a source from the DBSecurity Group.