database connection

General Support for technical Issues relating to AlegroCart
Post Reply
mike24williams
Posts: 57
Joined: Mon May 23, 2011 10:34 pm

database connection

Post by mike24williams » Mon Apr 16, 2012 5:26 am

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

User avatar
leo
admin
Posts: 4320
Joined: Sun Dec 13, 2009 8:27 am
Location: Hungary

Re: database connection

Post by leo » Mon Apr 16, 2012 5:49 am

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.

mike24williams
Posts: 57
Joined: Mon May 23, 2011 10:34 pm

Re: database connection

Post by mike24williams » Mon Apr 16, 2012 12:22 pm

Hi Leo,

I will do this today and get back.

best Regards

mike

mike24williams
Posts: 57
Joined: Mon May 23, 2011 10:34 pm

Re: database connection

Post by mike24williams » Mon Apr 16, 2012 12:35 pm

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

User avatar
Brent
Site Admin
Posts: 4459
Joined: Sat Dec 12, 2009 3:35 pm
Location: Canada eh

Re: database connection

Post by Brent » Mon Apr 16, 2012 12:49 pm

What do you mean by not connecting to database. What type of error are you getting and what process are you trying to do.

mike24williams
Posts: 57
Joined: Mon May 23, 2011 10:34 pm

Re: database connection

Post by mike24williams » Mon Apr 16, 2012 12:54 pm

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

alanrobinsonleigh
Posts: 2
Joined: Sun Apr 22, 2012 2:40 am

Re: database connection

Post by alanrobinsonleigh » Wed Apr 25, 2012 1:58 pm

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.

Post Reply