Many install guides tell you to enter localhost as the database host. On FimuroHost Cloud Hosting that won't work, and your site will show a database connection error.
The reason is simple, and so is the fix.
Why localhost doesn't work
On a traditional single-server host, the website and the database live on the same machine, so localhost (meaning "this computer") reaches the database. FimuroHost Cloud Hosting splits the work across dedicated machines: one set of servers handles web traffic, another runs MySQL, and storage sits on separate hardware. Because each job gets its own server, heavy database queries don't slow down page delivery (and the other way round).
The catch is that your database is on another machine, so your site has to connect to it by its real hostname.
Find your database hostname
- Log in to your FimuroHost client area, open Services and select your hosting plan.
- Click Login to Control Panel / StackCP. StackCP opens with the tools for that website (single sign-on, so there is no second password to type).
- Click MySQL Databases (in the Web Tools section).
- Copy the hostname shown for your database. It looks similar to
shareddb1b.hosting.stackcp.net, but yours will probably be different, so always copy it from your own account.
Where to enter it
WordPress
Edit wp-config.php in your site's root folder and set:
define( 'DB_HOST', 'your-db-hostname.hosting.stackcp.net' );
Laravel and other .env-based apps
DB_HOST=your-db-hostname.hosting.stackcp.net
Plain PHP (PDO)
$pdo = new PDO( 'mysql:host=your-db-hostname.hosting.stackcp.net;dbname=yourdb_abc;charset=utf8mb4', 'your_user', 'your_password' );
Replace the example values with the hostname, database name, username and password from StackCP.
Tips
- If you're moving a site from another host, the old config file almost certainly says
localhost. Update it before you test the site. - Some installers hide the host field under "advanced" options. Look for it before clicking install.
Need help?
If something doesn't work as described, open a support ticket from your client area or message us on WhatsApp at 01818160926. Tell us the domain name and what you have already tried, and we'll take it from there.
Categories
Written by
FimuroHost Team
Technical Writer