Can't connect to MWEB hosting's database

Giarc86

Expert Member
Joined
May 28, 2008
Messages
1,243
Reaction score
4
I signed up for the R19 a month UNIX uncapped hosting from MWEB and for some reason I can't connect to the database.
I have used the details they gave me to connect but it still wont.

I never had a problem on my previous host. I just changed the config file to reflect the new details when I switched to MWEB.

A Wordpress install wont work either.

Does anyone know why it wont connect? Is it possible MWEB messed something up?

PHP:
<?php
$servername='db1.swh.mweb.net';     
$dbusername='myusername';                
$dbpassword='mypass';                
$dbname='dbname';     

connecttodb($servername,$dbname,$dbusername,$dbpassword);
function connecttodb($servername,$dbname,$dbuser,$dbpassword)
{
global $link;
$link=mysql_connect ("$servername","$dbuser","$dbpassword");
if(!$link){die("Could not connect to MySQL");}
mysql_select_db("$dbname",$link) or die ("could not open db".mysql_error());
}

?>
 
Are you running that from your local machine or from the server?
I could not connect to the db and the support kind of hinted that it's only accessible once it is on the server.
 
From the server, nothing is trying to connect to 'db1.swh.mweb.net' from my localmachine
 
Do you have ssh access to the server where your domain is hosted? If so, log in and try to connect to the db using:

mysql -u username -p password -h hostname dbname

Also, what error do you see when trying to install Wordpress?
 
Do you have ssh access to the server where your domain is hosted? If so, log in and try to connect to the db using:

mysql -u username -p password -h hostname dbname

Also, what error do you see when trying to install Wordpress?

I can't connect via ssh, I did try with putty but it wasn't able to. Connection timed out.

The Wordpress error is "We were able to connect to the database server (which means your username and password is okay) but not able to select the DATABASENAME database."
 
Last edited:
Hi,
I don't know if you are sorted, but i found my DB name to be case sensitive ie. CLDBHOST_M864112x instead of small letters ^

Hope it helps :)
 
Top
Sign up to the MyBroadband newsletter
X