Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    45
    Plugin Contributions
    0

    Default Changing Database from 'localhost' to a IP Address.

    G'day Everyone,

    I am moving a Zen Cart Shop from a Server where the database resides on the same server as the website, and the site is setup for localhost to access the database, to a datacentre, that uses a different server to handle database requests.

    I have been given the IP of the Database Server, but need to know what I have to edit in Zen Cart to make the site access the Database via an IP rather than localhost?

    Does any one know how to do this?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing Database from 'localhost' to a IP Address.

    You have 2 configure.php files:
    /includes/configure.php
    /admin/includes/configure.php

    In both files you have a setting like this, which needs to be changed:
    Code:
      define('DB_SERVER', 'localhost');
    You may need to change the other DB_***** settings as well if your username/password/database-name are changing in the process.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Feb 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Changing Database from 'localhost' to a IP Address.

    Thanks for that.

    Ok here is the issue so far.

    My Old Server has the Database on the Same server, where as the new Host has the Database on a different Server.

    To test this new Host, I need to test to make sure everything works on the new host before I change the Name Servers for the actual domain over. So I have registered a NEW Domain for this testing.

    My Host uses cPanel, and I have added the new domain as a Parked domain so it will use the same files as normal.

    The Domain where I am testing the Zen Cart on the New Server is www.jn1.com.au/shop

    When you go here it says there is problems connecting to the database, below is what i edited in the php files

    /includes/configure.php

    ((( This is where I changed for the Domain Name Change)))

    define('HTTP_SERVER', 'http://jn1.com.au/shop');
    define('HTTPS_SERVER', 'https://seure.jumpnetwork.com.au/~becs1/shop/');


    (((Below is what I changed for the Local Host to IP Change)))

    define('DB_SERVER', '192.168.2.7'); // eg, localhost - should not be empty

    And in /admin/includes/configure.php

    ((( This is where I changed for the Domain Name Change)))

    define('HTTP_SERVER', 'http://jn1.com.au/shop');
    define('HTTPS_SERVER', 'https://secure.jumpnetwork.com.au/~becs1/shop');
    define('HTTP_CATALOG_SERVER', 'https://jn1.com.au/shop');
    define('HTTPS_CATALOG_SERVER', 'https://secure.jumpnetwork.com.au/~becs1/shop');

    (((Below is what I changed for the Local Host to IP Change)))

    define('DB_SERVER', '192.168.2.7'); // eg, localhost - should not be empty


    I have checked the Database in cPanel and made sure the user is correctly setup.

    Any help would be great.

    Thanks

    Chris.

  4. #4
    Join Date
    Feb 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Changing Database from 'localhost' to a IP Address.

    OK Guys, with some stuffing around in MySQL, I added a new user, and set permissions for that user, and now everything works.

    Thanks for you help guys.

  5. #5
    Join Date
    Feb 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Changing Database from 'localhost' to a IP Address.

    Post Deleted. Sorry.

  6. #6
    Join Date
    Feb 2007
    Posts
    45
    Plugin Contributions
    0

    Default Re: Changing Database from 'localhost' to a IP Address.



    Sorry for all these posts. The post above this one, had an issue, but i thought I fixed it, so i edited the posts and put post deleted.

    But the proplem still exists, and I can't edit that post any more

    please go to

    www.jn1.com.au/shop/index.php

    At the top of the screen you will see;

    [SCR]http://jn1.com.au/shop/includes/templates/template_default/images/icons/warning.gif[/SCR] Warning: I am able to write to the configuration file: /home/becs1/public_html/shop/includes/configure.php. This is a potential security risk - please set the right user permissions on this file (read-only, CHMOD 644 or 444 are typical).

    Now I have changed the permissions to 644 and the message is still there, and then changed them to 444 and the message is still there.

    I have also changed it for /admin/includes/configure.php

    What could be wrong now?

 

 

Similar Threads

  1. v151 changing sent from email address for customer order confirmations
    By Cameron14 in forum Managing Customers and Orders
    Replies: 7
    Last Post: 19 Jul 2014, 01:28 AM
  2. Can't restore database after moving from localhost
    By Annie_zaz in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 16 Sep 2013, 11:48 AM
  3. Changing FROM ADDRESS in emails
    By alexwoolfson in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 26 Dec 2010, 11:30 PM
  4. Fetch user email address from database
    By hoehnt in forum General Questions
    Replies: 6
    Last Post: 21 Dec 2009, 08:45 PM
  5. Printing customers address's from database
    By cushietushies in forum General Questions
    Replies: 2
    Last Post: 6 Nov 2008, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg