Support the ongoing development of Laravel.io →
posted 8 years ago
Configuration
Last updated 10 months ago.
0

Try this;

Instead of using the normal localhost address 127.0.0.1 within your config, change the address to 10.0.2.2.

Last updated 10 months ago.
0

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'

Last updated 10 months ago.
0

Dont specify the port in the host, add 'port' => '3308' to the config array.

Last updated 10 months ago.
0

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

Last updated 10 months ago.
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

opilo opilo Joined 20 Apr 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.

© 2023 Laravel.io - All rights reserved.