Page 1 of 1

database connection

Posted: Mon Apr 16, 2012 5:26 am
by mike24williams
Hi I have uploaded my files to the remote server and I cannot conect to the database.

these are the details I am using, I have changed the user and password for this discussion:-


Your Server Name: customguitarworkscou.ipagemysql.com
Database Name: cgwshop
Database Username: user1
Database Password: password1

the Alegro cart config file is looking for more information:-

define('CONFIG_VERSION', '1.2.6');
define('DB_HOST', 'customguitarworkscou.ipagemysql.com');
define('DB_USER', 'user1');
define('DB_PASSWORD', 'password1');
define('DB_NAME', 'cgwshop');
define('DIR_BASE', 'CGWshop/');
define('HTTP_BASE', 'http://www.customguitarworks.co.uk/CGWshop/');
define('HTTPS_BASE', '');

anybody got any ideas, i have tryed numerous combinations and have written test script and can connect to the database via this. but not the cart script.

i have a feeling the problem lies with the DIR_BASE but I am not sure.

Thanks in advance

best regards

mike

Re: database connection

Posted: Mon Apr 16, 2012 5:49 am
by leo
Create a file called test.hp with the content:

Code: Select all

<?php
echo getcwd();
?>
Upload it to your server where the store is, then open it in your browser.
http://www.customguitarworks.co.uk/CGWshop/test.php

You will get the DIR_BASE if you add a / to the end of the path.

Re: database connection

Posted: Mon Apr 16, 2012 12:22 pm
by mike24williams
Hi Leo,

I will do this today and get back.

best Regards

mike

Re: database connection

Posted: Mon Apr 16, 2012 12:35 pm
by mike24williams
I added the file and got the responce from the database, entered it and it still did not work. my script now reads ass follows I have left the test.php on the server

<?php

define('CONFIG_VERSION', '1.2.6');
define('DB_HOST', 'customguitarworkscou.ipagemysql.com');
define('DB_USER', 'user1');
define('DB_PASSWORD', 'password1');
define('DB_NAME', 'cgwshop');
define('DIR_BASE', '/hermes/bosweb26c/b2955/ipg.customguitarworkscou/CGWshop');
define('HTTP_BASE', 'http://www.customguitarworks.co.uk/CGWshop/');
define('HTTPS_BASE', '');

?>


any thoughts

regards

mike

Re: database connection

Posted: Mon Apr 16, 2012 12:49 pm
by Brent
What do you mean by not connecting to database. What type of error are you getting and what process are you trying to do.

Re: database connection

Posted: Mon Apr 16, 2012 12:54 pm
by mike24williams
hi brent,


/hermes/bosweb26c/b2955/ipg.customguitarworkscou/CGWshop


I run the code and got the path to the database on the remote server but I forgot to add / to the end in my script, it now works. thank you once again for you great support.

best regards

mike

Re: database connection

Posted: Wed Apr 25, 2012 1:58 pm
by alanrobinsonleigh
if i may add a reply. if you change DB_HOST to localhost it might connect to the database. it may be a silly reply.