Hed_Hakrayot Posted September 23, 2009 Posted September 23, 2009 Hi There, I am trying for couple of days to log in to the database - phpMyadmin at http://hedhakrayotsite.heliohost.org/ and my php file can't connect to the DB. I get this message : --------------------- Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'stevie.heliohost.org' (4) in /home/hkrayot/public_html/admin/connection_2hed_akrayot_DB.php on line 12 THERE WAS NO CONNECTION TO THE DB here is my code: /*******************************************************/ /************** CONNECT TO DB **************************/ /*******************************************************/ $cfgServerHost = 'stevie.heliohost.org:2082'; // MySQL hostname $cfgServerUser = 'hkrayot_hkrayo'; // MySQL user $cfgServerPassword = 'XXXX'; // have a correct MySQL password $cfgDbDatabase ='hkrayot_hedhakrayot' // I TRYED ALSO 'hedhakrayot'; // MySQL database name mysql_connect($cfgServerHost, $cfgServerUser, $cfgServerPassword) OR die('THERE WAS NO CONNECTION TO THE DB'); mysql_select_db($cfgDbDatabase) OR die('I COULD NOT FIND YOUR DB'); Quote
Ashoat Posted September 25, 2009 Posted September 25, 2009 You are trying to start a MySQL connection to cPanel. Not going to work. Use "localhost" for $cfgServerHost. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.