Try this;
Instead of using the normal localhost address 127.0.0.1 within your config, change the address to 10.0.2.2.
It works without a port (I also have a server on 3306) but with port 3308 i get this error: Unknown MySQL server host '10.0.2.2:3308'
Dont specify the port in the host, add 'port' => '3308' to the config array.
Yep, My fault. Actually i was using a simple MySQL example to test this:
$mysqli = new mysqli("10.0.2.2", "user", "password", "database", 3308);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
Thank a lot
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community