I am having a server running on my machine and I am calling it over the network. The Server is running fine and there have not been any problems with apache or php yet.
My database is not running on the same machine as apache but in the same local network on a server with the domain "sql.local.network.com".
Now i copied a Wordpress site onto my webserver which has been on another server in the same network, so it should work fine, since the database server is still accessable by both these webservers.
The problem now is, that Wordpress just shows the message Error establishing a database connection.
What I did was to access the database with phpmyadmin which I quickly set up on the server. This worked fine, and I was able to access the database.
Also I found a short skript:
<?php
$link = mysql_connect('sql.local.network.com', 'user', 'password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>
This echoed Connected successfully, which means a simple mysql_connect works fine as well.
Also I am able to ping sql.local.network.com over my console and get the response 192.168.0.101.
Everything works, but the Wordpress-page.
Is there a simple solution to fix the Wordpress connection problem I am missing?
the same network, so it should work fineNo it shouldn't. Check the mysqlmysql -> userstable, to see, whereusercan connect from. Maybe you need to check your firewall settings too.wp-config.phptoo?