Support the ongoing development of Laravel.io →
Authentication Security Database

Hi, I'm trying to execute:

% php artisan migrate

and I get the following error:

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'192.168.122.1' (using
password: YES)

In my app/config/database.php, I have set the host to 192.168.122.178.

When I created the user in mysql, I used the following command:

mysql> grant all privileges on forge.* to 'forge'@'192.168.122.178' identified by 'blah';

I can connect from the command line using the correct user, host, and password values. Also, I can telnet to the mysql machine on the mysql port, so it is not an issue of a firewall.

A funny thing, in the mysql log files, I see this error: [Warning] IP address '192.168.122.1' could not be resolved: Name or service not known

So, my question is, why is it picking up a truncated IP address everywhere?

When I echo $dsn in 'vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php', line 47, I get the correct value there.

What is going on???

Thank you for looking.

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

logicalguy logicalguy Joined 19 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.